Rollup merge of #122482 - weiznich:fix/122446, r=compiler-errors

Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint

This was missed during stablisation of the `#[diagnostic]` attribute namespace.

Fixes #122446
This commit is contained in:
Matthias Krüger 2024-03-14 15:44:36 +01:00 committed by GitHub
commit c0fd2db49a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 1 deletions

View File

@ -4355,7 +4355,6 @@ declare_lint! {
pub UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
Warn,
"unrecognized or malformed diagnostic attribute",
@feature_gate = sym::diagnostic_namespace;
}
declare_lint! {

View File

@ -0,0 +1,7 @@
#![deny(unknown_or_malformed_diagnostic_attributes)]
#[diagnostic::unknown_attribute]
//~^ERROR unknown diagnostic attribute
struct Foo;
fn main() {}

View File

@ -0,0 +1,14 @@
error: unknown diagnostic attribute
--> $DIR/deny_malformed_attribute.rs:3:15
|
LL | #[diagnostic::unknown_attribute]
| ^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/deny_malformed_attribute.rs:1:9
|
LL | #![deny(unknown_or_malformed_diagnostic_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error