Skip to content

Commit ba8fc92

Browse files
committed
Remove Span from hir::TraitItemRef.
1 parent fdd2c7d commit ba8fc92

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
@@ -850,7 +850,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
850850
};
851851
let id = hir::TraitItemId { hir_id: self.lower_node_id(i.id, i.span) };
852852
let defaultness = hir::Defaultness::Default { has_value: has_default };
853-
hir::TraitItemRef { id, ident: i.ident, span: i.span, defaultness, kind }
853+
hir::TraitItemRef { id, ident: i.ident, defaultness, kind }
854854
}
855855

856856
/// 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
@@ -2581,7 +2581,6 @@ pub struct TraitItemRef {
25812581
#[stable_hasher(project(name))]
25822582
pub ident: Ident,
25832583
pub kind: AssocItemKind,
2584-
pub span: Span,
25852584
pub defaultness: Defaultness,
25862585
}
25872586

compiler/rustc_hir/src/intravisit.rs

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

963963
pub fn walk_trait_item_ref<'v, V: Visitor<'v>>(visitor: &mut V, trait_item_ref: &'v TraitItemRef) {
964964
// N.B., deliberately force a compilation error if/when new fields are added.
965-
let TraitItemRef { id, ident, ref kind, span: _, ref defaultness } = *trait_item_ref;
965+
let TraitItemRef { id, ident, ref kind, ref defaultness } = *trait_item_ref;
966966
visitor.visit_nested_trait_item(id);
967967
visitor.visit_ident(ident);
968968
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
@@ -566,7 +566,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
566566
fn visit_trait_item_ref(&mut self, ii: &'hir TraitItemRef) {
567567
// Do not visit the duplicate information in TraitItemRef. We want to
568568
// map the actual nodes, not the duplicate ones in the *Ref.
569-
let TraitItemRef { id, ident: _, kind: _, span: _, defaultness: _ } = *ii;
569+
let TraitItemRef { id, ident: _, kind: _, defaultness: _ } = *ii;
570570

571571
self.visit_nested_trait_item(id);
572572
}

compiler/rustc_middle/src/ty/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ fn foo(&self) -> Self::T { String::new() }
816816
{
817817
if self.type_of(self.hir().local_def_id(item.id.hir_id)) == found {
818818
db.span_label(
819-
item.span,
819+
self.hir().span(item.id.hir_id),
820820
"associated type defaults can't be assumed inside the \
821821
trait defining them",
822822
);

0 commit comments

Comments
 (0)