Skip to content

Commit

Permalink
Fix the error in resolving trait associated types
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeeWee committed Jun 6, 2024
1 parent e25160b commit aff2893
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/builder/substs_specializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ impl<'tcx> SubstsSpecializer<'tcx> {
let param_env = self
.tcx
.param_env(self.tcx.associated_item(item_def_id).container_id(self.tcx));
let new_proj_type = Ty::new_projection(self.tcx, projection.def_id, specialized_substs);
if let Ok(specialized_type) = self.tcx.try_normalize_erasing_regions(param_env, new_proj_type) {
return specialized_type;
}
if let Ok(Some(instance)) = rustc_middle::ty::Instance::resolve(
self.tcx,
param_env,
Expand Down

0 comments on commit aff2893

Please sign in to comment.