Skip to content

Allow attribute does not surpress unknown_or_malformed_diagnostic_attributes #135772

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

Open
SpecificProtagonist opened this issue Jan 20, 2025 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. L-unknown_or_malformed_diagnostic_attributes Lint: unknown_or_malformed_diagnostic_attributes T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@SpecificProtagonist
Copy link
Contributor

SpecificProtagonist commented Jan 20, 2025

Code

trait _Trait {}
#[allow(unknown_or_malformed_diagnostic_attributes)]
#[diagnostic::abcdef]
impl _Trait for () {}

Current output

warning: unknown diagnostic attribute
 --> src/lib.rs:3:15
  |
3 | #[diagnostic::abcdef]
  |               ^^^^^^
  |
  = note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default

warning: `playground` (lib) generated 1 warning

Desired output

(no warning)

Rationale and extra context

See bevyengine/bevy#17441 for a case where this comes up, where it can't be worked around by introducing a module (because of #79260) or allowing it globally because the lint triggers in a macro.

Rust Version

rustc 1.86.0-nightly (9a1d156f3 2025-01-19)
binary: rustc
commit-hash: 9a1d156f38c51441ee51e5a068f1d0caf4bb0f27
commit-date: 2025-01-19
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
LLVM version: 19.1.7
@SpecificProtagonist SpecificProtagonist added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 20, 2025
@jieyouxu jieyouxu added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. C-bug Category: This is a bug. L-unknown_or_malformed_diagnostic_attributes Lint: unknown_or_malformed_diagnostic_attributes labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. L-unknown_or_malformed_diagnostic_attributes Lint: unknown_or_malformed_diagnostic_attributes T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants