1
Fork 0

Do not feed param_env for RPITITs impl side

This commit is contained in:
Santiago Pastorino 2023-03-22 14:04:20 -03:00
parent 439292bc79
commit 1c9ad28dd2
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
3 changed files with 5 additions and 5 deletions

View file

@ -130,7 +130,9 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
// FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty): I don't like this, we should
// at least be making sure that the generics in RPITITs and their parent fn don't
// get out of alignment, or else we do actually need to substitute these predicates.
if let Some(ImplTraitInTraitData::Trait { fn_def_id, .. }) = tcx.opt_rpitit_info(def_id) {
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;
}