Skip to content

Commit

Permalink
useless_attribute: allow ambiguous_glob_exports
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed May 2, 2024
1 parent 96e69d9 commit db0cbba
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions clippy_lints/src/attrs/useless_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
17 changes: 17 additions & 0 deletions tests/ui/useless_attribute.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
}
17 changes: 17 additions & 0 deletions tests/ui/useless_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
}

0 comments on commit db0cbba

Please sign in to comment.