1 #![warn(unused_attributes)]
3 // Tests that placing the #[no_mangle] attribute on a foreign fn or static emits
4 // a specialized warning.
5 // The previous warning only talks about a "function or static" but foreign fns/statics
6 // are also not allowed to have #[no_mangle]
12 //~^ WARNING `#[no_mangle]` has no effect on a foreign static
13 //~^^ WARNING this was previously accepted by the compiler
17 //~^ WARNING `#[no_mangle]` has no effect on a foreign function
18 //~^^ WARNING this was previously accepted by the compiler
23 // Should emit the generic "not a function or static" warning
25 //~^ WARNING attribute should be applied to a free function, impl method or static
26 //~^^ WARNING this was previously accepted by the compiler