// Can't use empty braced struct as enum pattern
+// aux-build:empty-struct.rs
+
#![feature(braced_empty_structs)]
+extern crate empty_struct;
+use empty_struct::*;
+
enum E {
- Empty2 {}
+ Empty3 {}
}
fn main() {
- let e2 = E::Empty2 {};
+ let e3 = E::Empty3 {};
+ let xe3 = XE::XEmpty3 {};
// Rejected by parser as yet
- // match e2 {
- // E::Empty2() => () // ERROR `E::Empty2` does not name a tuple variant or a tuple struct
+ // match e3 {
+ // E::Empty3() => () // ERROR `E::Empty3` does not name a tuple variant or a tuple struct
// }
- match e2 {
- E::Empty2(..) => () //~ ERROR `E::Empty2` does not name a tuple variant or a tuple struct
+ // match xe3 {
+ // E::Empty3() => () // ERROR `XE::XEmpty3` does not name a tuple variant or a tuple struct
+ // }
+ match e3 {
+ E::Empty3(..) => () //~ ERROR `E::Empty3` does not name a tuple variant or a tuple struct
+ }
+ match xe3 {
+ XE::XEmpty3(..) => () //~ ERROR no associated item named `XEmpty3` found for type
}
}