Skip to content

Commit 4491f82

Browse files
committed
Remove Span from hir::TypeBinding.
1 parent e6c0698 commit 4491f82

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11881188
hir_id: self.lower_node_id(constraint.id, constraint.span),
11891189
ident: constraint.ident,
11901190
kind,
1191-
span: constraint.span,
11921191
}
11931192
}
11941193

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(
@@ -425,6 +425,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
425425
) -> hir::TypeBinding<'hir> {
426426
let ident = Ident::with_dummy_span(hir::FN_OUTPUT_NAME);
427427
let kind = hir::TypeBindingKind::Equality { ty };
428-
hir::TypeBinding { hir_id: self.next_id(span), span, ident, kind }
428+
hir::TypeBinding { hir_id: self.next_id(span), ident, kind }
429429
}
430430
}

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,6 @@ pub struct TypeBinding<'hir> {
19561956
#[stable_hasher(project(name))]
19571957
pub ident: Ident,
19581958
pub kind: TypeBindingKind<'hir>,
1959-
pub span: Span,
19601959
}
19611960

19621961
// 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
@@ -404,7 +404,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
404404
}
405405

406406
if position != GenericArgPosition::Type && !args.bindings.is_empty() {
407-
AstConv::prohibit_assoc_ty_binding(tcx, args.bindings[0].span);
407+
AstConv::prohibit_assoc_ty_binding(tcx, tcx.hir().span(args.bindings[0].hir_id));
408408
}
409409

410410
let explicit_late_bound =

compiler/rustc_typeck/src/astconv/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
548548
ConvertedBindingKind::Constraint(bounds)
549549
}
550550
};
551-
ConvertedBinding { item_name: binding.ident, kind, span: binding.span }
551+
ConvertedBinding {
552+
item_name: binding.ident,
553+
kind,
554+
span: tcx.hir().span(binding.hir_id),
555+
}
552556
})
553557
.collect();
554558

@@ -1798,7 +1802,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
17981802
// Only emit the first error to avoid overloading the user with error messages.
17991803
if let [binding, ..] = segment.generic_args().bindings {
18001804
has_err = true;
1801-
Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
1805+
Self::prohibit_assoc_ty_binding(self.tcx(), self.tcx().hir().span(binding.hir_id));
18021806
}
18031807
}
18041808
has_err

0 commit comments

Comments
 (0)