rust/tests/ui/lint/unused/match_with_guard.stderr
Alan Egerton 1087b41a83 Fix missing unused_variables lint when using a match guard
Within a binding pattern match guard, only real reads of a bound local
impact its liveness analysis - not the fake read that is injected.

(cherry picked from commit 5aba6b1635)
2026-02-12 09:06:20 -08:00

15 lines
433 B
Text

warning: unused variable: `unused`
--> $DIR/match_with_guard.rs:7:14
|
LL | Some(unused) if true => (),
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
note: the lint level is defined here
--> $DIR/match_with_guard.rs:4:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
warning: 1 warning emitted