summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/useless_attribute.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:21 +0000
commit4e8199b572f2035b7749cba276ece3a26630d23e (patch)
treef09feeed6a0fe39d027b1908aa63ea6b35e4b631 /src/tools/clippy/tests/ui/useless_attribute.rs
parentAdding upstream version 1.66.0+dfsg1. (diff)
downloadrustc-4e8199b572f2035b7749cba276ece3a26630d23e.tar.xz
rustc-4e8199b572f2035b7749cba276ece3a26630d23e.zip
Adding upstream version 1.67.1+dfsg1.upstream/1.67.1+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/useless_attribute.rs')
-rw-r--r--src/tools/clippy/tests/ui/useless_attribute.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/tools/clippy/tests/ui/useless_attribute.rs b/src/tools/clippy/tests/ui/useless_attribute.rs
index 7a7b198ea..cb50736ba 100644
--- a/src/tools/clippy/tests/ui/useless_attribute.rs
+++ b/src/tools/clippy/tests/ui/useless_attribute.rs
@@ -1,6 +1,7 @@
// run-rustfix
// aux-build:proc_macro_derive.rs
+#![allow(unused)]
#![warn(clippy::useless_attribute)]
#![warn(unreachable_pub)]
#![feature(rustc_private)]
@@ -16,6 +17,13 @@ extern crate rustc_middle;
#[macro_use]
extern crate proc_macro_derive;
+fn test_indented_attr() {
+ #[allow(clippy::almost_swapped)]
+ use std::collections::HashSet;
+
+ let _ = HashSet::<u32>::default();
+}
+
// don't lint on unused_import for `use` items
#[allow(unused_imports)]
use std::collections;
@@ -63,13 +71,16 @@ mod c {
pub(crate) struct S;
}
-fn test_indented_attr() {
- #[allow(clippy::almost_swapped)]
- use std::collections::HashSet;
-
- let _ = HashSet::<u32>::default();
+// https://github.com/rust-lang/rust-clippy/issues/7511
+pub mod split {
+ #[allow(clippy::module_name_repetitions)]
+ pub use regex::SplitN;
}
+// https://github.com/rust-lang/rust-clippy/issues/8768
+#[allow(clippy::single_component_path_imports)]
+use regex;
+
fn main() {
test_indented_attr();
}