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