about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/attrs/useless_attribute.rs1
-rw-r--r--tests/ui/useless_attribute.fixed17
-rw-r--r--tests/ui/useless_attribute.rs17
3 files changed, 35 insertions, 0 deletions
diff --git a/clippy_lints/src/attrs/useless_attribute.rs b/clippy_lints/src/attrs/useless_attribute.rs
index 00f324e4de5..f6f4d780440 100644
--- a/clippy_lints/src/attrs/useless_attribute.rs
+++ b/clippy_lints/src/attrs/useless_attribute.rs
@@ -28,6 +28,7 @@ pub(super) fn check(cx: &LateContext<'_>, item: &Item<'_>, attrs: &[Attribute])
                                 || is_word(lint, sym!(unused_braces))
                                 || is_word(lint, sym::dead_code)
                                 || is_word(lint, sym!(hidden_glob_reexports))
+                                || is_word(lint, sym!(ambiguous_glob_reexports))
                                 || extract_clippy_lint(lint).map_or(false, |s| {
                                     matches!(
                                         s.as_str(),
diff --git a/tests/ui/useless_attribute.fixed b/tests/ui/useless_attribute.fixed
index 401c384c39c..231fc0a892a 100644
--- a/tests/ui/useless_attribute.fixed
+++ b/tests/ui/useless_attribute.fixed
@@ -117,3 +117,20 @@ pub mod hidden_glob_reexports {
     #[allow(hidden_glob_reexports)]
     use my_uncool_type::MyUncoolType as MyCoolType;
 }
+
+// Regression test for https://github.com/rust-lang/rust-clippy/issues/10878
+pub mod ambiguous_glob_exports {
+    #![allow(unreachable_pub)]
+
+    mod my_prelude {
+        pub struct MyType;
+    }
+
+    mod my_type {
+        pub struct MyType;
+    }
+
+    #[allow(ambiguous_glob_reexports)]
+    pub use my_prelude::*;
+    pub use my_type::*;
+}
diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs
index 6629942ff5e..8dfcd2110a4 100644
--- a/tests/ui/useless_attribute.rs
+++ b/tests/ui/useless_attribute.rs
@@ -117,3 +117,20 @@ pub mod hidden_glob_reexports {
     #[allow(hidden_glob_reexports)]
     use my_uncool_type::MyUncoolType as MyCoolType;
 }
+
+// Regression test for https://github.com/rust-lang/rust-clippy/issues/10878
+pub mod ambiguous_glob_exports {
+    #![allow(unreachable_pub)]
+
+    mod my_prelude {
+        pub struct MyType;
+    }
+
+    mod my_type {
+        pub struct MyType;
+    }
+
+    #[allow(ambiguous_glob_reexports)]
+    pub use my_prelude::*;
+    pub use my_type::*;
+}