Skip to content

Commit 43d915c

Browse files
committed
remove span calls from deprecated attribute checking
1 parent 956f47c commit 43d915c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_passes/src/check_attr.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
179179
Attribute::Parsed(AttributeKind::AllowConstFnUnstable(_, first_span)) => {
180180
self.check_rustc_allow_const_fn_unstable(hir_id, *first_span, span, target)
181181
}
182-
Attribute::Parsed(AttributeKind::Deprecation { .. }) => {
183-
self.check_deprecated(hir_id, attr, span, target)
182+
Attribute::Parsed(AttributeKind::Deprecation {span: attr_span, .. }) => {
183+
self.check_deprecated(hir_id, *attr_span, target)
184184
}
185185
Attribute::Parsed(AttributeKind::TargetFeature{ attr_span, ..}) => {
186186
self.check_target_feature(hir_id, *attr_span, target, attrs)
@@ -1861,7 +1861,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
18611861
}
18621862
}
18631863

1864-
fn check_deprecated(&self, hir_id: HirId, attr: &Attribute, _span: Span, target: Target) {
1864+
fn check_deprecated(&self, hir_id: HirId, attr_span: Span, target: Target) {
18651865
match target {
18661866
Target::AssocConst | Target::Method(..) | Target::AssocTy
18671867
if matches!(
@@ -1872,8 +1872,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
18721872
self.tcx.emit_node_span_lint(
18731873
UNUSED_ATTRIBUTES,
18741874
hir_id,
1875-
attr.span(),
1876-
errors::DeprecatedAnnotationHasNoEffect { span: attr.span() },
1875+
attr_span,
1876+
errors::DeprecatedAnnotationHasNoEffect { span: attr_span },
18771877
);
18781878
}
18791879
_ => {}

0 commit comments

Comments
 (0)