Skip to content

Commit db0cbba

Browse files
committed
useless_attribute: allow ambiguous_glob_exports
Closes #10878
1 parent 96e69d9 commit db0cbba

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

clippy_lints/src/attrs/useless_attribute.rs

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub(super) fn check(cx: &LateContext<'_>, item: &Item<'_>, attrs: &[Attribute])
2828
|| is_word(lint, sym!(unused_braces))
2929
|| is_word(lint, sym::dead_code)
3030
|| is_word(lint, sym!(hidden_glob_reexports))
31+
|| is_word(lint, sym!(ambiguous_glob_reexports))
3132
|| extract_clippy_lint(lint).map_or(false, |s| {
3233
matches!(
3334
s.as_str(),

tests/ui/useless_attribute.fixed

+17
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,20 @@ pub mod hidden_glob_reexports {
117117
#[allow(hidden_glob_reexports)]
118118
use my_uncool_type::MyUncoolType as MyCoolType;
119119
}
120+
121+
// Regression test for https://github.com/rust-lang/rust-clippy/issues/10878
122+
pub mod ambiguous_glob_exports {
123+
#![allow(unreachable_pub)]
124+
125+
mod my_prelude {
126+
pub struct MyType;
127+
}
128+
129+
mod my_type {
130+
pub struct MyType;
131+
}
132+
133+
#[allow(ambiguous_glob_reexports)]
134+
pub use my_prelude::*;
135+
pub use my_type::*;
136+
}

tests/ui/useless_attribute.rs

+17
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,20 @@ pub mod hidden_glob_reexports {
117117
#[allow(hidden_glob_reexports)]
118118
use my_uncool_type::MyUncoolType as MyCoolType;
119119
}
120+
121+
// Regression test for https://github.com/rust-lang/rust-clippy/issues/10878
122+
pub mod ambiguous_glob_exports {
123+
#![allow(unreachable_pub)]
124+
125+
mod my_prelude {
126+
pub struct MyType;
127+
}
128+
129+
mod my_type {
130+
pub struct MyType;
131+
}
132+
133+
#[allow(ambiguous_glob_reexports)]
134+
pub use my_prelude::*;
135+
pub use my_type::*;
136+
}

0 commit comments

Comments
 (0)