about summary refs log tree commit diff
path: root/src/test/compile-fail/empty-struct-braces-expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/compile-fail/empty-struct-braces-expr.rs')
-rw-r--r--src/test/compile-fail/empty-struct-braces-expr.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/test/compile-fail/empty-struct-braces-expr.rs b/src/test/compile-fail/empty-struct-braces-expr.rs
index 67167086b9c..6ae0dad0e7b 100644
--- a/src/test/compile-fail/empty-struct-braces-expr.rs
+++ b/src/test/compile-fail/empty-struct-braces-expr.rs
@@ -10,17 +10,28 @@
 
 // Can't use empty braced struct as constant or constructor function
 
+// aux-build:empty-struct.rs
+
 #![feature(braced_empty_structs)]
 
+extern crate empty_struct;
+use empty_struct::*;
+
 struct Empty1 {}
 
 enum E {
-    Empty2 {}
+    Empty3 {}
 }
 
 fn main() {
     let e1 = Empty1; //~ ERROR `Empty1` is the name of a struct or struct variant
     let e1 = Empty1(); //~ ERROR `Empty1` is the name of a struct or struct variant
-    let e2 = E::Empty2; //~ ERROR `E::Empty2` is the name of a struct or struct variant
-    let e2 = E::Empty2(); //~ ERROR `E::Empty2` is the name of a struct or struct variant
+    let e3 = E::Empty3; //~ ERROR `E::Empty3` is the name of a struct or struct variant
+    let e3 = E::Empty3(); //~ ERROR `E::Empty3` is the name of a struct or struct variant
+
+    // FIXME: non-local struct kind should be known early (e.g. kept in `DefStruct`)
+    // let xe1 = XEmpty1; // ERROR `XEmpty1` is the name of a struct or struct variant
+    let xe1 = XEmpty1(); //~ ERROR expected function, found `empty_struct::XEmpty1`
+    let xe3 = XE::Empty3; //~ ERROR no associated item named `Empty3` found for type
+    let xe3 = XE::Empty3(); //~ ERROR no associated item named `Empty3` found for type
 }