rust/tests/ui/pattern/match-at-pattern-shadows-name.rs
2025-12-10 09:23:50 +09:00

12 lines
283 B
Rust

fn main() {
match Some(1) {
None @ _ => {} //~ ERROR match bindings cannot shadow unit variants
};
const C: u8 = 1;
match 1 {
C @ 2 => { //~ ERROR match bindings cannot shadow constant
println!("{}", C);
}
_ => {}
};
}