diff options
| author | Georg Semmler <github@weiznich.de> | 2024-03-14 10:49:28 +0100 |
|---|---|---|
| committer | Georg Semmler <github@weiznich.de> | 2024-03-14 10:49:28 +0100 |
| commit | 25411113c1185bd08841bbedeb4e52279f8e5f13 (patch) | |
| tree | 7c9ff3566268f7e5dc3614815d53c6fea756fb32 | |
| parent | 6f3eb1ce3d50246b2cbc5de3107c0f34889f5cc6 (diff) | |
| download | rust-25411113c1185bd08841bbedeb4e52279f8e5f13.tar.gz rust-25411113c1185bd08841bbedeb4e52279f8e5f13.zip | |
Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint
This was missed during stablisation of the `#[diagnostic]` attribute namespace. Fixes #122446
| -rw-r--r-- | compiler/rustc_lint_defs/src/builtin.rs | 1 | ||||
| -rw-r--r-- | tests/ui/diagnostic_namespace/deny_malformed_attribute.rs | 7 | ||||
| -rw-r--r-- | tests/ui/diagnostic_namespace/deny_malformed_attribute.stderr | 14 |
3 files changed, 21 insertions, 1 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 20e492dbd8a..b9e183f48f4 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -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! { diff --git a/tests/ui/diagnostic_namespace/deny_malformed_attribute.rs b/tests/ui/diagnostic_namespace/deny_malformed_attribute.rs new file mode 100644 index 00000000000..1d946a14aff --- /dev/null +++ b/tests/ui/diagnostic_namespace/deny_malformed_attribute.rs @@ -0,0 +1,7 @@ +#![deny(unknown_or_malformed_diagnostic_attributes)] + +#[diagnostic::unknown_attribute] +//~^ERROR unknown diagnostic attribute +struct Foo; + +fn main() {} diff --git a/tests/ui/diagnostic_namespace/deny_malformed_attribute.stderr b/tests/ui/diagnostic_namespace/deny_malformed_attribute.stderr new file mode 100644 index 00000000000..a646d3613de --- /dev/null +++ b/tests/ui/diagnostic_namespace/deny_malformed_attribute.stderr @@ -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 + |
