Files
rust/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs

19 lines
354 B
Rust
Raw Normal View History

#![feature(non_exhaustive)]
#[non_exhaustive(anything)]
//~^ ERROR attribute must be of the form
struct Foo;
#[non_exhaustive]
2018-06-10 14:04:48 +02:00
//~^ ERROR attribute can only be applied to a struct or enum [E0701]
trait Bar { }
#[non_exhaustive]
2018-06-10 14:04:48 +02:00
//~^ ERROR attribute can only be applied to a struct or enum [E0701]
union Baz {
f1: u16,
f2: u16
}
fn main() { }