3 #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896
5 #[no_mangle] const DISCOVERY: usize = 1;
6 //~^ ERROR const items should never be `#[no_mangle]`
7 //~| HELP try a static value
10 //~^ HELP remove this attribute
11 pub fn defiant<T>(_t: T) {}
12 //~^ WARN functions generic over types or consts must be mangled
18 // The private-no-mangle lints shouldn't suggest inserting `pub` when the
19 // item is already `pub` (but triggered the lint because, e.g., it's in a
20 // private module). (Issue #47383)
21 #[no_mangle] pub const DAUNTLESS: bool = true;
22 //~^ ERROR const items should never be `#[no_mangle]`
23 //~| HELP try a static value
24 #[no_mangle] pub fn val_jean<T>() {}
25 //~^ WARN functions generic over types or consts must be mangled
26 //~| HELP remove this attribute
28 // ... but we can suggest just-`pub` instead of restricted
29 #[no_mangle] pub(crate) const VETAR: bool = true;
30 //~^ ERROR const items should never be `#[no_mangle]`
31 //~| HELP try a static value
32 #[no_mangle] pub(crate) fn crossfield<T>() {}
33 //~^ WARN functions generic over types or consts must be mangled
34 //~| HELP remove this attribute
43 //~^ WARN denote infinite loops
45 let mut registry_no = (format!("NX-{}", 74205));
46 //~^ WARN does not need to be mutable
47 //~| HELP remove this `mut`
48 //~| WARN unnecessary parentheses
49 //~| HELP remove these parentheses
50 // the line after `mut` has a `\t` at the beginning, this is on purpose
53 //~^^ WARN does not need to be mutable
54 //~| HELP remove this `mut`
55 let d = Equinox { warp_factor: 9.975 };
57 Equinox { warp_factor: warp_factor } => {}
58 //~^ WARN this pattern is redundant
59 //~| HELP use shorthand field pattern
61 println!("{} {}", registry_no, b);