You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![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.
The text was updated successfully, but these errors were encountered:
Code:
Error message:
It's unclear how
cast
can be shadowed bya
, given that they have different names. Something like "cast
shadowed bycast
" or "cast
variable shadowed by anif let
binding" might be more understandable.The text was updated successfully, but these errors were encountered: