Skip to content

Commit

Permalink
Ungate the UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES lint
Browse files Browse the repository at this point in the history
This was missed during stablisation of the `#[diagnostic]` attribute
namespace.

Fixes #122446
  • Loading branch information
weiznich committed Mar 14, 2024
1 parent 6f3eb1c commit 2541111
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 0 additions & 1 deletion compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4341,7 +4341,6 @@ declare_lint! {
pub UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
Warn,
"unrecognized or malformed diagnostic attribute",
@feature_gate = sym::diagnostic_namespace;
}

declare_lint! {
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/diagnostic_namespace/deny_malformed_attribute.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![deny(unknown_or_malformed_diagnostic_attributes)]

#[diagnostic::unknown_attribute]
//~^ERROR unknown diagnostic attribute
struct Foo;

fn main() {}
14 changes: 14 additions & 0 deletions tests/ui/diagnostic_namespace/deny_malformed_attribute.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2541111

Please sign in to comment.