4 const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
6 const VAR_TWO: &str = "Test constant #2"; // This line should not raise a warning.
8 const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
10 const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
12 const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
14 const VAR_SIX: &'static u8 = &5;
16 const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
18 const VAR_HEIGHT: &'static Foo = &Foo {};
20 const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR Consider removing 'static.
22 const VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR Consider removing 'static.
24 const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
27 let false_positive: &'static str = "test";
28 println!("{}", VAR_ONE);
29 println!("{}", VAR_TWO);
30 println!("{:?}", VAR_THREE);
31 println!("{:?}", VAR_FOUR);
32 println!("{:?}", VAR_FIVE);
33 println!("{:?}", VAR_SIX);
34 println!("{:?}", VAR_SEVEN);
35 println!("{:?}", VAR_HEIGHT);
36 println!("{}", false_positive);
40 const TRAIT_VAR: &'static str;
44 const IMPL_VAR: &'static str = "var";
48 const TRAIT_VAR: &'static str = "foo";