Skip to content

Commit

Permalink
Do not remove previously added predicates in param_env, extend them i…
Browse files Browse the repository at this point in the history
…nstead
  • Loading branch information
spastorino committed Jun 29, 2023
1 parent 373293c commit 33d21e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_ty_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
if let Some(ImplTraitInTraitData::Trait { fn_def_id, .. })
| Some(ImplTraitInTraitData::Impl { fn_def_id, .. }) = tcx.opt_rpitit_info(def_id)
{
predicates = tcx.predicates_of(fn_def_id).instantiate_identity(tcx).predicates;
// FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty): Should not need to add the predicates
// from the parent fn to our assumptions
predicates.extend(tcx.predicates_of(fn_def_id).instantiate_identity(tcx).predicates);
}

// Finally, we have to normalize the bounds in the environment, in
Expand Down

0 comments on commit 33d21e6

Please sign in to comment.