]> git.proxmox.com Git - rustc.git/blobdiff - src/test/compile-fail/empty-struct-braces-pat-3.rs
Imported Upstream version 1.7.0+dfsg1
[rustc.git] / src / test / compile-fail / empty-struct-braces-pat-3.rs
index 9fae203f3894d4f42232953d7f4e978a825bd1c0..ca51a1cfc2186f64214843b591385cb82fb8ab92 100644 (file)
 
 // 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
     }
 }