Skip to content

Commit 6459750

Browse files
committed
Remove span from hir::ForeignItemRef.
1 parent 346176f commit 6459750

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
738738
hir::ForeignItemRef {
739739
id: hir::ForeignItemId { def_id: self.lower_node_id(i.id, i.span).expect_owner() },
740740
ident: i.ident,
741-
span: i.span,
742741
vis: self.lower_visibility(&i.vis, Some(i.id)),
743742
}
744743
}

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,6 @@ pub struct ForeignItemRef<'hir> {
28762876
pub id: ForeignItemId,
28772877
#[stable_hasher(project(name))]
28782878
pub ident: Ident,
2879-
pub span: Span,
28802879
pub vis: Visibility<'hir>,
28812880
}
28822881

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ pub fn walk_foreign_item_ref<'v, V: Visitor<'v>>(
992992
foreign_item_ref: &'v ForeignItemRef<'v>,
993993
) {
994994
// N.B., deliberately force a compilation error if/when new fields are added.
995-
let ForeignItemRef { id, ident, span: _, ref vis } = *foreign_item_ref;
995+
let ForeignItemRef { id, ident, ref vis } = *foreign_item_ref;
996996
visitor.visit_nested_foreign_item(id);
997997
visitor.visit_ident(ident);
998998
visitor.visit_vis(vis);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
564564
fn visit_foreign_item_ref(&mut self, fi: &'hir ForeignItemRef<'hir>) {
565565
// Do not visit the duplicate information in ForeignItemRef. We want to
566566
// map the actual nodes, not the duplicate ones in the *Ref.
567-
let ForeignItemRef { id, ident: _, span: _, vis: _ } = *fi;
567+
let ForeignItemRef { id, ident: _, vis: _ } = *fi;
568568

569569
self.visit_nested_foreign_item(id);
570570
}

compiler/rustc_typeck/src/check/check.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,14 +814,15 @@ pub fn check_item_type<'tcx>(tcx: TyCtxt<'tcx>, it: &'tcx hir::Item<'tcx>) {
814814
(0, _) => ("const", "consts", None),
815815
_ => ("type or const", "types or consts", None),
816816
};
817+
let item_span = tcx.hir().span(item.id.hir_id());
817818
struct_span_err!(
818819
tcx.sess,
819-
item.span,
820+
item_span,
820821
E0044,
821822
"foreign items may not have {} parameters",
822823
kinds,
823824
)
824-
.span_label(item.span, &format!("can't have {} parameters", kinds))
825+
.span_label(item_span, &format!("can't have {} parameters", kinds))
825826
.help(
826827
// FIXME: once we start storing spans for type arguments, turn this
827828
// into a suggestion.

0 commit comments

Comments
 (0)