diff options
Diffstat (limited to 'tests/ui/used.rs')
-rw-r--r-- | tests/ui/used.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/used.rs b/tests/ui/used.rs new file mode 100644 index 000000000..f008724f4 --- /dev/null +++ b/tests/ui/used.rs @@ -0,0 +1,16 @@ +#[used] +static FOO: u32 = 0; // OK + +#[used] //~ ERROR attribute must be applied to a `static` variable +fn foo() {} + +#[used] //~ ERROR attribute must be applied to a `static` variable +struct Foo {} + +#[used] //~ ERROR attribute must be applied to a `static` variable +trait Bar {} + +#[used] //~ ERROR attribute must be applied to a `static` variable +impl Bar for Foo {} + +fn main() {} |