Auto merge of #43990 - tamird:defid-not-name, r=eddyb
librustc_typeck: store a DefId rather than a Name r? @eddyb cc @tschottdorf
This commit is contained in:
commit
5af17242cc
4 changed files with 5 additions and 7 deletions
|
|
@ -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 `{}`",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue