rust/tests/ui/consts/const-enum-structlike.rs
2023-01-11 09:32:08 +00:00

17 lines
233 B
Rust

// run-pass
#![allow(dead_code)]
enum E {
S0 { s: String },
S1 { u: usize }
}
static C: E = E::S1 { u: 23 };
pub fn main() {
match C {
E::S0 { .. } => panic!(),
E::S1 { u } => assert_eq!(u, 23)
}
}