diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-01-14 14:26:50 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-01-15 19:57:53 +0300 |
| commit | ccb4b35897c0356bb397fe045fa23ddbce9fc134 (patch) | |
| tree | 395778e0f9f1e96f92593c4021d08b5c77bab9fe /src/test/compile-fail/empty-struct-braces-expr.rs | |
| parent | 1f4e317e45349eb2d3c853e96bfd24dd574b36d1 (diff) | |
| download | rust-ccb4b35897c0356bb397fe045fa23ddbce9fc134.tar.gz rust-ccb4b35897c0356bb397fe045fa23ddbce9fc134.zip | |
Preserve struct/variant kinds in metadata
Add tests for use of empty structs in cross-crate scenarios
Diffstat (limited to 'src/test/compile-fail/empty-struct-braces-expr.rs')
| -rw-r--r-- | src/test/compile-fail/empty-struct-braces-expr.rs | 17 |
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 } |
