Skip to content

Commit ed0b627

Browse files
committed
Remove Span from hir::TypeBinding.
1 parent 415ad17 commit ed0b627

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/librustc_ast_lowering/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11481148
hir_id: self.lower_node_id(constraint.id, constraint.span),
11491149
ident: constraint.ident,
11501150
kind,
1151-
span: constraint.span,
11521151
}
11531152
}
11541153

src/librustc_ast_lowering/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
270270
.args
271271
.first()
272272
.map(|a| self.spans[a.id()])
273-
.or_else(|| generic_args.bindings.first().map(|b| b.span));
273+
.or_else(|| generic_args.bindings.first().map(|b| self.spans[b.hir_id]));
274274
if !generic_args.parenthesized && !has_lifetimes {
275275
generic_args.args = self
276276
.elided_path_lifetimes(
@@ -427,6 +427,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
427427
) -> hir::TypeBinding<'hir> {
428428
let ident = Ident::with_dummy_span(hir::FN_OUTPUT_NAME);
429429
let kind = hir::TypeBindingKind::Equality { ty };
430-
hir::TypeBinding { hir_id: self.next_id(span), span, ident, kind }
430+
hir::TypeBinding { hir_id: self.next_id(span), ident, kind }
431431
}
432432
}

src/librustc_hir/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,6 @@ pub struct TypeBinding<'hir> {
19381938
#[stable_hasher(project(name))]
19391939
pub ident: Ident,
19401940
pub kind: TypeBindingKind<'hir>,
1941-
pub span: Span,
19421941
}
19431942

19441943
// Represents the two kinds of type bindings.

src/librustc_typeck/astconv.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
342342
}
343343

344344
if position != GenericArgPosition::Type && !args.bindings.is_empty() {
345-
AstConv::prohibit_assoc_ty_binding(tcx, args.bindings[0].span);
345+
AstConv::prohibit_assoc_ty_binding(tcx, tcx.hir().span(args.bindings[0].hir_id));
346346
}
347347

348348
let explicit_late_bound =
@@ -911,7 +911,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
911911
ConvertedBindingKind::Constraint(bounds)
912912
}
913913
};
914-
ConvertedBinding { item_name: binding.ident, kind, span: binding.span }
914+
ConvertedBinding {
915+
item_name: binding.ident,
916+
kind,
917+
span: tcx.hir().span(binding.hir_id),
918+
}
915919
})
916920
.collect();
917921

@@ -2505,7 +2509,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
25052509
// Only emit the first error to avoid overloading the user with error messages.
25062510
if let [binding, ..] = segment.generic_args().bindings {
25072511
has_err = true;
2508-
Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
2512+
Self::prohibit_assoc_ty_binding(self.tcx(), self.tcx().hir().span(binding.hir_id));
25092513
}
25102514
}
25112515
has_err

0 commit comments

Comments
 (0)