]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/useless_attribute.rs
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / useless_attribute.rs
index 529680a7588a654619babc1b3f8ee7fa8e4f8135..3422eace4ab97d81613ab2d27a3082fb174cd2ea 100644 (file)
@@ -1,3 +1,4 @@
+// run-rustfix
 // aux-build:proc_macro_derive.rs
 
 #![warn(clippy::useless_attribute)]
@@ -10,7 +11,7 @@
 #[allow(unused_imports)]
 #[allow(unused_extern_crates)]
 #[macro_use]
-extern crate rustc;
+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]
@@ -44,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();
+}