useless_attribute: allow ambiguous_glob_exports

Closes https://github.com/rust-lang/rust-clippy/issues/10878
This commit is contained in:
Rebecca Turner 2024-05-02 11:57:27 -07:00
parent 96e69d9b43
commit db0cbbacb7
No known key found for this signature in database
3 changed files with 35 additions and 0 deletions

View File

@ -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(),

View File

@ -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::*;
}

View File

@ -117,3 +117,20 @@ mod my_uncool_type {
#[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::*;
}