From 43d915c42641c4ebdfbdd7290513ccc16dd06942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Tue, 14 Oct 2025 17:45:32 +0200 Subject: [PATCH] remove span calls from deprecated attribute checking --- compiler/rustc_passes/src/check_attr.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index cba6243fa1098..80ab38aca6cae 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -179,8 +179,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> { Attribute::Parsed(AttributeKind::AllowConstFnUnstable(_, first_span)) => { self.check_rustc_allow_const_fn_unstable(hir_id, *first_span, span, target) } - Attribute::Parsed(AttributeKind::Deprecation { .. }) => { - self.check_deprecated(hir_id, attr, span, target) + Attribute::Parsed(AttributeKind::Deprecation {span: attr_span, .. }) => { + self.check_deprecated(hir_id, *attr_span, target) } Attribute::Parsed(AttributeKind::TargetFeature{ attr_span, ..}) => { self.check_target_feature(hir_id, *attr_span, target, attrs) @@ -1861,7 +1861,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } } - fn check_deprecated(&self, hir_id: HirId, attr: &Attribute, _span: Span, target: Target) { + fn check_deprecated(&self, hir_id: HirId, attr_span: Span, target: Target) { match target { Target::AssocConst | Target::Method(..) | Target::AssocTy if matches!( @@ -1872,8 +1872,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> { self.tcx.emit_node_span_lint( UNUSED_ATTRIBUTES, hir_id, - attr.span(), - errors::DeprecatedAnnotationHasNoEffect { span: attr.span() }, + attr_span, + errors::DeprecatedAnnotationHasNoEffect { span: attr_span }, ); } _ => {}