mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
33 lines
911 B
Rust
33 lines
911 B
Rust
#![allow(incomplete_features)]
|
|
#![feature(unnamed_fields)]
|
|
|
|
struct F {
|
|
field1: struct { field2: u8 }, //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
|
|
_: struct { field3: u8 },
|
|
}
|
|
|
|
struct G {
|
|
_: (u8, u8), //~ ERROR unnamed fields can only have struct or union types
|
|
}
|
|
|
|
union H {
|
|
field1: struct { field2: u8 }, //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
|
|
_: struct { field3: u8 },
|
|
}
|
|
|
|
union I {
|
|
_: (u8, u8), //~ ERROR unnamed fields can only have struct or union types
|
|
}
|
|
|
|
enum K {
|
|
M {
|
|
_ : struct { field: u8 }, //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
|
|
//~^ ERROR unnamed fields are not allowed outside of structs or unions
|
|
},
|
|
N {
|
|
_ : u8, //~ ERROR unnamed fields are not allowed outside of structs or unions
|
|
}
|
|
}
|
|
|
|
fn main() {}
|