Skip to content

Commit a0b4ad1

Browse files
committed
Remove span from hir::ForeignItemRef.
1 parent 272df28 commit a0b4ad1

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

compiler/rustc_ast_lowering/src/item.rs

-1
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
732732
hir::ForeignItemRef {
733733
id: hir::ForeignItemId { hir_id: self.lower_node_id(i.id, i.span) },
734734
ident: i.ident,
735-
span: i.span,
736735
vis: self.lower_visibility(&i.vis, Some(i.id)),
737736
}
738737
}

compiler/rustc_hir/src/hir.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,6 @@ pub struct ForeignItemRef<'hir> {
26262626
pub id: ForeignItemId,
26272627
#[stable_hasher(project(name))]
26282628
pub ident: Ident,
2629-
pub span: Span,
26302629
pub vis: Visibility<'hir>,
26312630
}
26322631

compiler/rustc_hir/src/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ pub fn walk_foreign_item_ref<'v, V: Visitor<'v>>(
10131013
foreign_item_ref: &'v ForeignItemRef<'v>,
10141014
) {
10151015
// N.B., deliberately force a compilation error if/when new fields are added.
1016-
let ForeignItemRef { id, ident, span: _, ref vis } = *foreign_item_ref;
1016+
let ForeignItemRef { id, ident, ref vis } = *foreign_item_ref;
10171017
visitor.visit_nested_foreign_item(id);
10181018
visitor.visit_ident(ident);
10191019
visitor.visit_vis(vis);

compiler/rustc_middle/src/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
582582
fn visit_foreign_item_ref(&mut self, fi: &'hir ForeignItemRef<'hir>) {
583583
// Do not visit the duplicate information in ForeignItemRef. We want to
584584
// map the actual nodes, not the duplicate ones in the *Ref.
585-
let ForeignItemRef { id, ident: _, span: _, vis: _ } = *fi;
585+
let ForeignItemRef { id, ident: _, vis: _ } = *fi;
586586

587587
self.visit_nested_foreign_item(id);
588588
}

compiler/rustc_typeck/src/check/check.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -776,14 +776,15 @@ pub fn check_item_type<'tcx>(tcx: TyCtxt<'tcx>, it: &'tcx hir::Item<'tcx>) {
776776
(0, _) => ("const", "consts", None),
777777
_ => ("type or const", "types or consts", None),
778778
};
779+
let item_span = tcx.hir().span(item.id.hir_id);
779780
struct_span_err!(
780781
tcx.sess,
781-
item.span,
782+
item_span,
782783
E0044,
783784
"foreign items may not have {} parameters",
784785
kinds,
785786
)
786-
.span_label(item.span, &format!("can't have {} parameters", kinds))
787+
.span_label(item_span, &format!("can't have {} parameters", kinds))
787788
.help(
788789
// FIXME: once we start storing spans for type arguments, turn this
789790
// into a suggestion.

0 commit comments

Comments
 (0)