Skip to content

Commit 56871a5

Browse files
committed
Remove Span from hir::TraitItemRef.
1 parent a29261d commit 56871a5

File tree

5 files changed

+4
-5
lines changed

5 files changed

+4
-5
lines changed

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
866866
};
867867
let id = hir::TraitItemId { def_id: self.lower_node_id(i.id, i.span).expect_owner() };
868868
let defaultness = hir::Defaultness::Default { has_value: has_default };
869-
hir::TraitItemRef { id, ident: i.ident, span: i.span, defaultness, kind }
869+
hir::TraitItemRef { id, ident: i.ident, defaultness, kind }
870870
}
871871

872872
/// Construct `ExprKind::Err` for the given `span`.

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2823,7 +2823,6 @@ pub struct TraitItemRef {
28232823
#[stable_hasher(project(name))]
28242824
pub ident: Ident,
28252825
pub kind: AssocItemKind,
2826-
pub span: Span,
28272826
pub defaultness: Defaultness,
28282827
}
28292828

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ pub fn walk_trait_item<'v, V: Visitor<'v>>(visitor: &mut V, trait_item: &'v Trai
950950

951951
pub fn walk_trait_item_ref<'v, V: Visitor<'v>>(visitor: &mut V, trait_item_ref: &'v TraitItemRef) {
952952
// N.B., deliberately force a compilation error if/when new fields are added.
953-
let TraitItemRef { id, ident, ref kind, span: _, ref defaultness } = *trait_item_ref;
953+
let TraitItemRef { id, ident, ref kind, ref defaultness } = *trait_item_ref;
954954
visitor.visit_nested_trait_item(id);
955955
visitor.visit_ident(ident);
956956
visitor.visit_associated_item_kind(kind);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
548548
fn visit_trait_item_ref(&mut self, ii: &'hir TraitItemRef) {
549549
// Do not visit the duplicate information in TraitItemRef. We want to
550550
// map the actual nodes, not the duplicate ones in the *Ref.
551-
let TraitItemRef { id, ident: _, kind: _, span: _, defaultness: _ } = *ii;
551+
let TraitItemRef { id, ident: _, kind: _, defaultness: _ } = *ii;
552552

553553
self.visit_nested_trait_item(id);
554554
}

compiler/rustc_middle/src/ty/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ fn foo(&self) -> Self::T { String::new() }
833833
{
834834
if self.type_of(item.id.def_id) == found {
835835
db.span_label(
836-
item.span,
836+
self.hir().span(item.id.hir_id()),
837837
"associated type defaults can't be assumed inside the \
838838
trait defining them",
839839
);

0 commit comments

Comments
 (0)