about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/builtin.rs
diff options
context:
space:
mode:
authormejrs <59372212+mejrs@users.noreply.github.com>2025-05-18 18:35:13 +0200
committermejrs <59372212+mejrs@users.noreply.github.com>2025-06-09 11:44:24 +0200
commit959d6de1a928061256bb845025597be11ddca2ea (patch)
tree18d17efbdd2c330cb8d7793df929261fb548c11b /compiler/rustc_lint/src/builtin.rs
parent52882f6522ae9f34f1d574b2efabc4b18e691ae0 (diff)
downloadrust-959d6de1a928061256bb845025597be11ddca2ea.tar.gz
rust-959d6de1a928061256bb845025597be11ddca2ea.zip
refactor `AttributeGate` and `rustc_attr!` to emit notes during feature checking
Diffstat (limited to 'compiler/rustc_lint/src/builtin.rs')
-rw-r--r--compiler/rustc_lint/src/builtin.rs21
1 files changed, 9 insertions, 12 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 47b80135bae..2e09ef75be4 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -818,25 +818,22 @@ impl EarlyLintPass for DeprecatedAttr {
     fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &ast::Attribute) {
         for BuiltinAttribute { name, gate, .. } in &self.depr_attrs {
             if attr.ident().map(|ident| ident.name) == Some(*name) {
-                if let &AttributeGate::Gated(
-                    Stability::Deprecated(link, suggestion),
-                    name,
-                    reason,
-                    _,
-                ) = gate
+                if let &AttributeGate::Gated {
+                    stability: Stability::Deprecated(link, suggestion),
+                    message,
+                    ..
+                } = gate
                 {
                     let suggestion = match suggestion {
-                        Some(msg) => {
-                            BuiltinDeprecatedAttrLinkSuggestion::Msg { suggestion: attr.span, msg }
-                        }
-                        None => {
-                            BuiltinDeprecatedAttrLinkSuggestion::Default { suggestion: attr.span }
+                        Some(suggestion) => {
+                            BuiltinDeprecatedAttrLinkSuggestion::Msg { span: attr.span, suggestion }
                         }
+                        None => BuiltinDeprecatedAttrLinkSuggestion::Default { span: attr.span },
                     };
                     cx.emit_span_lint(
                         DEPRECATED,
                         attr.span,
-                        BuiltinDeprecatedAttrLink { name, reason, link, suggestion },
+                        BuiltinDeprecatedAttrLink { name: *name, message, link, suggestion },
                     );
                 }
                 return;