]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/useless_attribute.rs
iterate List by value
[rust.git] / tests / ui / useless_attribute.rs
index dd84b1b2c1c381570d276a43aa052d45b7cb01db..3422eace4ab97d81613ab2d27a3082fb174cd2ea 100644 (file)
@@ -1,17 +1,17 @@
+// run-rustfix
 // aux-build:proc_macro_derive.rs
 
 #![warn(clippy::useless_attribute)]
 #![warn(unreachable_pub)]
+#![feature(rustc_private)]
 
 #[allow(dead_code)]
 #[cfg_attr(feature = "cargo-clippy", allow(dead_code))]
 #[rustfmt::skip]
-#[cfg_attr(feature = "cargo-clippy",
-           allow(dead_code))]
 #[allow(unused_imports)]
 #[allow(unused_extern_crates)]
 #[macro_use]
-extern crate clippy_lints;
+extern crate rustc_middle;
 
 #[macro_use]
 extern crate proc_macro_derive;
 #[allow(unused_imports)]
 use std::collections;
 
+// don't lint on unused for `use` items
+#[allow(unused)]
+use std::option;
+
 // don't lint on deprecated for `use` items
 mod foo {
     #[deprecated]
@@ -45,4 +49,13 @@ pub struct C {}
     pub use self::b::C;
 }
 
-fn main() {}
+fn test_indented_attr() {
+    #[allow(clippy::almost_swapped)]
+    use std::collections::HashSet;
+
+    let _ = HashSet::<u32>::default();
+}
+
+fn main() {
+    test_indented_attr();
+}