mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
868706d9b5
Anonymous structs or unions are only allowed in struct field definitions. Co-authored-by: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com>
27 lines
650 B
Rust
27 lines
650 B
Rust
struct Foo {
|
|
foo: u8,
|
|
_: union { //~ ERROR unnamed fields are not yet fully implemented [E0658]
|
|
//~^ ERROR unnamed fields are not yet fully implemented [E0658]
|
|
//~| ERROR anonymous unions are unimplemented
|
|
bar: u8,
|
|
baz: u16
|
|
}
|
|
}
|
|
|
|
union Bar {
|
|
foobar: u8,
|
|
_: struct { //~ ERROR unnamed fields are not yet fully implemented [E0658]
|
|
//~^ ERROR unnamed fields are not yet fully implemented [E0658]
|
|
//~| ERROR anonymous structs are unimplemented
|
|
foobaz: u8,
|
|
barbaz: u16
|
|
}
|
|
}
|
|
|
|
struct S;
|
|
struct Baz {
|
|
_: S //~ ERROR unnamed fields are not yet fully implemented [E0658]
|
|
}
|
|
|
|
fn main(){}
|