]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs
Auto merge of #94738 - Urgau:rustbuild-check-cfg-values, r=Mark-Simulacrum
[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() { }