Skip to content

Commit 00ce893

Browse files
committed
Remove Span from hir::TraitItemRef.
1 parent 56ee3f9 commit 00ce893

File tree

5 files changed

+4
-5
lines changed

5 files changed

+4
-5
lines changed

src/librustc_ast_lowering/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
807807
};
808808
let id = hir::TraitItemId { hir_id: self.lower_node_id(i.id, i.span) };
809809
let defaultness = hir::Defaultness::Default { has_value: has_default };
810-
hir::TraitItemRef { id, ident: i.ident, span: i.span, defaultness, kind }
810+
hir::TraitItemRef { id, ident: i.ident, defaultness, kind }
811811
}
812812

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

src/librustc_hir/hir.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,6 @@ pub struct TraitItemRef {
25642564
#[stable_hasher(project(name))]
25652565
pub ident: Ident,
25662566
pub kind: AssocItemKind,
2567-
pub span: Span,
25682567
pub defaultness: Defaultness,
25692568
}
25702569

src/librustc_hir/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ pub fn walk_trait_item<'v, V: Visitor<'v>>(visitor: &mut V, trait_item: &'v Trai
932932

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

src/librustc_middle/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
540540
fn visit_trait_item_ref(&mut self, ii: &'hir TraitItemRef) {
541541
// Do not visit the duplicate information in TraitItemRef. We want to
542542
// map the actual nodes, not the duplicate ones in the *Ref.
543-
let TraitItemRef { id, ident: _, kind: _, span: _, defaultness: _ } = *ii;
543+
let TraitItemRef { id, ident: _, kind: _, defaultness: _ } = *ii;
544544

545545
self.visit_nested_trait_item(id);
546546
}

src/librustc_middle/ty/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ fn foo(&self) -> Self::T { String::new() }
821821
{
822822
if self.type_of(self.hir().local_def_id(item.id.hir_id)) == found {
823823
db.span_label(
824-
item.span,
824+
self.hir().span(item.id.hir_id),
825825
"associated type defaults can't be assumed inside the \
826826
trait defining them",
827827
);

0 commit comments

Comments
 (0)