]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/redundant_static_lifetimes.rs
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / redundant_static_lifetimes.rs
index fc9f0e066d43f61e1591eeb90c4fe8ac5f5ebc14..f2f0f78659c936516fab442fd624e1ba7f5164a0 100644 (file)
@@ -1,5 +1,9 @@
+// run-rustfix
+
+#![allow(unused)]
+
 #[derive(Debug)]
-struct Foo {}
+struct Foo;
 
 const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
 
@@ -9,12 +13,8 @@ struct Foo {}
 
 const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
 
-const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
-
 const VAR_SIX: &'static u8 = &5;
 
-const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
-
 const VAR_HEIGHT: &'static Foo = &Foo {};
 
 const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR Consider removing 'static.
@@ -29,14 +29,8 @@ struct Foo {}
 
 static STATIC_VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
 
-static STATIC_VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
-
-static STATIC_VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
-
 static STATIC_VAR_SIX: &'static u8 = &5;
 
-static STATIC_VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
-
 static STATIC_VAR_HEIGHT: &'static Foo = &Foo {};
 
 static STATIC_VAR_SLICE: &'static [u8] = b"Test static #3"; // ERROR Consider removing 'static.
@@ -47,15 +41,6 @@ struct Foo {}
 
 fn main() {
     let false_positive: &'static str = "test";
-    println!("{}", VAR_ONE);
-    println!("{}", VAR_TWO);
-    println!("{:?}", VAR_THREE);
-    println!("{:?}", VAR_FOUR);
-    println!("{:?}", VAR_FIVE);
-    println!("{:?}", VAR_SIX);
-    println!("{:?}", VAR_SEVEN);
-    println!("{:?}", VAR_HEIGHT);
-    println!("{}", false_positive);
 }
 
 trait Bar {