Skip to content

Commit 5af1724

Browse files
committed
Auto merge of #43990 - tamird:defid-not-name, r=eddyb
librustc_typeck: store a DefId rather than a Name r? @eddyb cc @tschottdorf
2 parents 7f397bd + ceeb399 commit 5af1724

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/librustc/infer/error_reporting/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
899899
infer::LateBoundRegion(_, br, infer::HigherRankedType) => {
900900
format!(" for lifetime parameter {}in generic type", br_string(br))
901901
}
902-
infer::LateBoundRegion(_, br, infer::AssocTypeProjection(type_name)) => {
902+
infer::LateBoundRegion(_, br, infer::AssocTypeProjection(def_id)) => {
903903
format!(" for lifetime parameter {}in trait containing associated type `{}`",
904-
br_string(br), type_name)
904+
br_string(br), self.tcx.associated_item(def_id).name)
905905
}
906906
infer::EarlyBoundRegion(_, name) => {
907907
format!(" for lifetime parameter `{}`",

src/librustc/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ pub enum LateBoundRegionConversionTime {
274274
HigherRankedType,
275275

276276
/// when projecting an associated type
277-
AssocTypeProjection(ast::Name), // FIXME(tschottdorf): should contain DefId, not Name
277+
AssocTypeProjection(DefId),
278278
}
279279

280280
/// Reasons to create a region inference variable

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,11 +1646,10 @@ impl<'a, 'gcx, 'tcx> AstConv<'gcx, 'tcx> for FnCtxt<'a, 'gcx, 'tcx> {
16461646
poly_trait_ref: ty::PolyTraitRef<'tcx>)
16471647
-> Ty<'tcx>
16481648
{
1649-
let item = self.tcx().associated_item(item_def_id);
16501649
let (trait_ref, _) =
16511650
self.replace_late_bound_regions_with_fresh_var(
16521651
span,
1653-
infer::LateBoundRegionConversionTime::AssocTypeProjection(item.name),
1652+
infer::LateBoundRegionConversionTime::AssocTypeProjection(item_def_id),
16541653
&poly_trait_ref);
16551654

16561655
self.tcx().mk_projection(item_def_id, trait_ref.substs)

src/librustc_typeck/check/regionck.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,8 +1805,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
18051805
let (outlives, _) =
18061806
self.replace_late_bound_regions_with_fresh_var(
18071807
span,
1808-
infer::AssocTypeProjection(
1809-
self.tcx.associated_item(projection_ty.item_def_id).name),
1808+
infer::AssocTypeProjection(projection_ty.item_def_id),
18101809
&outlives);
18111810

18121811
debug!("projection_bounds: outlives={:?} (3)",

0 commit comments

Comments
 (0)