]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unused/unused-attr.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / unused / unused-attr.rs
1 #![deny(unused_attributes)]
2 #![allow(dead_code, unused_imports, unused_extern_crates)]
3 #![feature(custom_attribute)]
4
5 #![foo] //~ ERROR unused attribute
6
7 #[foo] //~ ERROR unused attribute
8 extern crate core;
9
10 #[foo] //~ ERROR unused attribute
11 use std::collections;
12
13 #[foo] //~ ERROR unused attribute
14 extern "C" {
15     #[foo] //~ ERROR unused attribute
16     fn foo();
17 }
18
19 #[foo] //~ ERROR unused attribute
20 mod foo {
21     #[foo] //~ ERROR unused attribute
22     pub enum Foo {
23         #[foo] //~ ERROR unused attribute
24         Bar,
25     }
26 }
27
28 #[foo] //~ ERROR unused attribute
29 fn bar(f: foo::Foo) {
30     match f {
31         #[foo] //~ ERROR unused attribute
32         foo::Foo::Bar => {}
33     }
34 }
35
36 #[foo] //~ ERROR unused attribute
37 struct Foo {
38     #[foo] //~ ERROR unused attribute
39     a: isize
40 }
41
42 #[foo] //~ ERROR unused attribute
43 trait Baz {
44     #[foo] //~ ERROR unused attribute
45     fn blah(&self);
46     #[foo] //~ ERROR unused attribute
47     fn blah2(&self) {}
48 }
49
50 fn main() {}