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)
15 lines
433 B
Text
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
|
|
|