]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs
Rollup merge of #94356 - Thomasdezeeuw:stabilize_unix_socket_creation, r=dtolnay
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / invalid-attribute.rs
1 #[non_exhaustive(anything)]
2 //~^ ERROR malformed `non_exhaustive` attribute
3 struct Foo;
4
5 #[non_exhaustive]
6 //~^ ERROR attribute can only be applied to a struct or enum [E0701]
7 trait Bar { }
8
9 #[non_exhaustive]
10 //~^ ERROR attribute can only be applied to a struct or enum [E0701]
11 union Baz {
12     f1: u16,
13     f2: u16
14 }
15
16 fn main() { }