diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index d608d09d05498..8281d4716c4ce 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -899,9 +899,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { infer::LateBoundRegion(_, br, infer::HigherRankedType) => { format!(" for lifetime parameter {}in generic type", br_string(br)) } - infer::LateBoundRegion(_, br, infer::AssocTypeProjection(type_name)) => { + infer::LateBoundRegion(_, br, infer::AssocTypeProjection(def_id)) => { format!(" for lifetime parameter {}in trait containing associated type `{}`", - br_string(br), type_name) + br_string(br), self.tcx.associated_item(def_id).name) } infer::EarlyBoundRegion(_, name) => { format!(" for lifetime parameter `{}`", diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 186eab724db36..6c9b9d853f403 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -274,7 +274,7 @@ pub enum LateBoundRegionConversionTime { HigherRankedType, /// when projecting an associated type - AssocTypeProjection(ast::Name), // FIXME(tschottdorf): should contain DefId, not Name + AssocTypeProjection(DefId), } /// Reasons to create a region inference variable diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 2489a8c694127..dbdaabfee8ab5 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1646,11 +1646,10 @@ impl<'a, 'gcx, 'tcx> AstConv<'gcx, 'tcx> for FnCtxt<'a, 'gcx, 'tcx> { poly_trait_ref: ty::PolyTraitRef<'tcx>) -> Ty<'tcx> { - let item = self.tcx().associated_item(item_def_id); let (trait_ref, _) = self.replace_late_bound_regions_with_fresh_var( span, - infer::LateBoundRegionConversionTime::AssocTypeProjection(item.name), + infer::LateBoundRegionConversionTime::AssocTypeProjection(item_def_id), &poly_trait_ref); self.tcx().mk_projection(item_def_id, trait_ref.substs) diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index 73c243d27d1cf..180fecf1c9cfc 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -1805,8 +1805,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { let (outlives, _) = self.replace_late_bound_regions_with_fresh_var( span, - infer::AssocTypeProjection( - self.tcx.associated_item(projection_ty.item_def_id).name), + infer::AssocTypeProjection(projection_ty.item_def_id), &outlives); debug!("projection_bounds: outlives={:?} (3)",