4 #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896
6 #[no_mangle] pub static 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 static DAUNTLESS: bool = true;
23 //~^ ERROR const items should never be `#[no_mangle]`
24 //~| HELP try a static value
25 #[allow(dead_code)] // for rustfix
26 pub fn val_jean<T>() {}
27 //~^ WARN functions generic over types or consts must be mangled
28 //~| HELP remove this attribute
30 // ... but we can suggest just-`pub` instead of restricted
31 #[no_mangle] pub static VETAR: bool = true;
32 //~^ ERROR const items should never be `#[no_mangle]`
33 //~| HELP try a static value
34 #[allow(dead_code)] // for rustfix
35 pub(crate) fn crossfield<T>() {}
36 //~^ WARN functions generic over types or consts must be mangled
37 //~| HELP remove this attribute
46 //~^ WARN denote infinite loops
48 let registry_no = format!("NX-{}", 74205);
49 //~^ WARN does not need to be mutable
50 //~| HELP remove this `mut`
51 //~| WARN unnecessary parentheses
52 //~| HELP remove these parentheses
53 // the line after `mut` has a `\t` at the beginning, this is on purpose
55 //~^^ WARN does not need to be mutable
56 //~| HELP remove this `mut`
57 let d = Equinox { warp_factor: 9.975 };
59 #[allow(unused_variables)] // for rustfix
60 Equinox { warp_factor } => {}
61 //~^ WARN this pattern is redundant
62 //~| HELP use shorthand field pattern
64 println!("{} {}", registry_no, b);