Closed
Description
cargo clippy -V
clippy 0.0.212 (2e26fdc 2018-11-22)
Code:
#![deny(clippy::shadow_unrelated)]
enum A {
B { cast: i32, },
C
}
fn fun(cast: u32) {
let a = A::C;
if let A::B { cast } = a {
println!("{}", cast);
}
}
fn main() {
println!("Hello, world!");
}
Error message:
error: `cast` is shadowed by `a`
It's unclear how cast
can be shadowed by a
, given that they have different names. Something like "cast
shadowed by cast
" or "cast
variable shadowed by an if let
binding" might be more understandable.