about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/context/diagnostics.rs
diff options
context:
space:
mode:
authorcarbotaniuman <41451839+carbotaniuman@users.noreply.github.com>2024-06-08 18:39:09 -0500
committercarbotaniuman <41451839+carbotaniuman@users.noreply.github.com>2024-06-23 19:02:14 -0500
commita23917cfd07b309f32603c6acb81b63aad8504e7 (patch)
tree7ead8d9df7c78555088b9e034441f202ab30d94e /compiler/rustc_lint/src/context/diagnostics.rs
parent33422e72c8a66bdb5ee21246a948a1a02ca91674 (diff)
downloadrust-a23917cfd07b309f32603c6acb81b63aad8504e7.tar.gz
rust-a23917cfd07b309f32603c6acb81b63aad8504e7.zip
Add hard error and migration lint for unsafe attrs
Diffstat (limited to 'compiler/rustc_lint/src/context/diagnostics.rs')
-rw-r--r--compiler/rustc_lint/src/context/diagnostics.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/context/diagnostics.rs b/compiler/rustc_lint/src/context/diagnostics.rs
index 290bb5173db..adb2a3275c0 100644
--- a/compiler/rustc_lint/src/context/diagnostics.rs
+++ b/compiler/rustc_lint/src/context/diagnostics.rs
@@ -319,6 +319,16 @@ pub(super) fn decorate_lint(sess: &Session, diagnostic: BuiltinLintDiag, diag: &
         BuiltinLintDiag::UnusedQualifications { removal_span } => {
             lints::UnusedQualifications { removal_span }.decorate_lint(diag);
         }
+        BuiltinLintDiag::UnsafeAttrOutsideUnsafe {
+            attribute_name_span,
+            sugg_spans: (left, right),
+        } => {
+            lints::UnsafeAttrOutsideUnsafe {
+                span: attribute_name_span,
+                suggestion: lints::UnsafeAttrOutsideUnsafeSuggestion { left, right },
+            }
+            .decorate_lint(diag);
+        }
         BuiltinLintDiag::AssociatedConstElidedLifetime {
             elided,
             span: lt_span,