Skip to content

Commit 66e1a16

Browse files
committed
Remove Span from hir::TypeBinding.
1 parent ec5cd74 commit 66e1a16

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
12621262
ident: constraint.ident,
12631263
gen_args,
12641264
kind,
1265-
span: constraint.span,
12661265
}
12671266
}
12681267

compiler/rustc_ast_lowering/src/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
268268
.args
269269
.first()
270270
.map(|a| self.spans[a.id()])
271-
.or_else(|| generic_args.bindings.first().map(|b| b.span));
271+
.or_else(|| generic_args.bindings.first().map(|b| self.spans[b.hir_id]));
272272
if !generic_args.parenthesized && !has_lifetimes {
273273
generic_args.args = self
274274
.elided_path_lifetimes(
@@ -428,6 +428,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
428428
let args = arena_vec![self;];
429429
let bindings = arena_vec![self;];
430430
let gen_args = self.arena.alloc(hir::GenericArgs { args, bindings, parenthesized: false });
431-
hir::TypeBinding { hir_id: self.next_id(span), gen_args, span, ident, kind }
431+
hir::TypeBinding { hir_id: self.next_id(span), gen_args, ident, kind }
432432
}
433433
}

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,6 @@ pub struct TypeBinding<'hir> {
21312131
pub ident: Ident,
21322132
pub gen_args: &'hir GenericArgs<'hir>,
21332133
pub kind: TypeBindingKind<'hir>,
2134-
pub span: Span,
21352134
}
21362135

21372136
// Represents the two kinds of type bindings.

compiler/rustc_typeck/src/astconv/generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
432432
let infer_lifetimes = gen_pos != GenericArgPosition::Type && arg_counts.lifetimes == 0;
433433

434434
if gen_pos != GenericArgPosition::Type && !gen_args.bindings.is_empty() {
435-
Self::prohibit_assoc_ty_binding(tcx, gen_args.bindings[0].span);
435+
Self::prohibit_assoc_ty_binding(tcx, tcx.hir().span(gen_args.bindings[0].hir_id));
436436
}
437437

438438
let explicit_late_bound =

compiler/rustc_typeck/src/astconv/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
572572
item_name: binding.ident,
573573
kind,
574574
gen_args: binding.gen_args,
575-
span: binding.span,
575+
span: tcx.hir().span(binding.hir_id),
576576
}
577577
})
578578
.collect();
@@ -1897,7 +1897,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
18971897
// Only emit the first error to avoid overloading the user with error messages.
18981898
if let [binding, ..] = segment.args().bindings {
18991899
has_err = true;
1900-
Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
1900+
Self::prohibit_assoc_ty_binding(self.tcx(), self.tcx().hir().span(binding.hir_id));
19011901
}
19021902
}
19031903
has_err

0 commit comments

Comments
 (0)