]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-47725.rs
Merge commit '4911ab124c481430672a3833b37075e6435ec34d' into clippyup
[rust.git] / src / test / ui / issues / issue-47725.rs
1 // ignore-tidy-linelength
2 #![warn(unused_attributes)] //~ NOTE lint level is defined here
3
4 #[link_name = "foo"]
5 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
6 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7 struct Foo; //~ NOTE not a foreign function or static
8
9 #[link_name = "foobar"]
10 //~^ WARN attribute should be applied to a foreign function or static [unused_attributes]
11 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
12 //~| HELP try `#[link(name = "foobar")]` instead
13 extern "C" {
14     fn foo() -> u32;
15 }
16 //~^^^ NOTE not a foreign function or static
17
18 #[link_name]
19 //~^ ERROR malformed `link_name` attribute input
20 //~| HELP must be of the form
21 //~| WARN attribute should be applied to a foreign function or static [unused_attributes]
22 //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
23 //~| HELP try `#[link(name = "...")]` instead
24 extern "C" {
25     fn bar() -> u32;
26 }
27 //~^^^ NOTE not a foreign function or static
28
29 fn main() {}