Files
rust/tests/ui/pattern/or-pattern-mismatched-variable-and-variant.rs
T
2026-01-31 14:01:54 +01:00

20 lines
426 B
Rust

//! regression test for <https://github.com/rust-lang/rust/issues/2848>
#[allow(non_camel_case_types)]
mod bar {
pub enum foo {
alpha,
beta,
charlie
}
}
fn main() {
use bar::foo::{alpha, charlie};
match alpha {
alpha | beta => {} //~ ERROR variable `beta` is not bound in all patterns
//~^ ERROR `beta` is named the same as one of the variants
charlie => {}
}
}