Skip to content

Commit

Permalink
Rollup merge of #122482 - weiznich:fix/122446, r=compiler-errors
Browse files Browse the repository at this point in the history
Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint

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

Fixes #122446
  • Loading branch information
matthiaskrgr authored Mar 14, 2024
2 parents 8303c6a + 2541111 commit c0fd2db
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 @@ -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! {
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 c0fd2db

Please sign in to comment.