Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect clippy::useless_attribute for ambiguous_glob_reexports #10878

Closed
SamRodri opened this issue Jun 2, 2023 · 1 comment · Fixed by #12755
Closed

Incorrect clippy::useless_attribute for ambiguous_glob_reexports #10878

SamRodri opened this issue Jun 2, 2023 · 1 comment · Fixed by #12755
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@SamRodri
Copy link

SamRodri commented Jun 2, 2023

Summary

The new stable (rust 1.70) ambiguous_glob_reexports is valid in use items.

Lint Name

useless_attribute

Reproducer

I tried this code:

mod foo1 {
    pub struct Foo;
}

mod foo2 {
    pub struct Foo;
}

// #[allow(clippy::useless_attribute)]
#[allow(ambiguous_glob_reexports)]
pub use foo1::*;
pub use foo2::*;

I saw this happen:

Deny error in #[allow(ambiguous_glob_reexports)].

I expected to see this happen:

No error

Version

rustc 1.70.0 (90c541806 2023-05-31)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: x86_64-pc-windows-msvc
release: 1.70.0
LLVM version: 16.0.2

Additional Labels

No response

@SamRodri SamRodri added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Jun 2, 2023
@blyxyas
Copy link
Member

blyxyas commented Jun 3, 2023

@rustbot claim

@blyxyas blyxyas removed their assignment Jun 3, 2023
9999years added a commit to 9999years/rust-clippy that referenced this issue May 2, 2024
bors added a commit that referenced this issue May 6, 2024
…umeGomez

Allow more attributes in `clippy::useless_attribute`

Fixes #12753
Fixes #4467
Fixes #11595
Fixes #10878

changelog: [`useless_attribute`]: Attributes allowed on `use` items now include `ambiguous_glob_exports`, `hidden_glob_reexports`, `dead_code`, `unused_braces`, and `clippy::disallowed_types`.
@bors bors closed this as completed in db0cbba May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants