Do not feed param_env for RPITITs impl side
This commit is contained in:
parent
439292bc79
commit
1c9ad28dd2
3 changed files with 5 additions and 5 deletions
|
@ -384,10 +384,6 @@ fn associated_type_for_impl_trait_in_impl(
|
||||||
opt_rpitit_info: Some(ImplTraitInTraitData::Impl { fn_def_id: impl_fn_def_id.to_def_id() }),
|
opt_rpitit_info: Some(ImplTraitInTraitData::Impl { fn_def_id: impl_fn_def_id.to_def_id() }),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Copy param_env of the containing function. The synthesized associated type doesn't have
|
|
||||||
// extra predicates to assume.
|
|
||||||
impl_assoc_ty.param_env(tcx.param_env(impl_fn_def_id));
|
|
||||||
|
|
||||||
// Copy visility of the containing function.
|
// Copy visility of the containing function.
|
||||||
impl_assoc_ty.visibility(tcx.visibility(impl_fn_def_id));
|
impl_assoc_ty.visibility(tcx.visibility(impl_fn_def_id));
|
||||||
|
|
||||||
|
|
|
@ -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
|
// 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
|
// 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.
|
// 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;
|
predicates = tcx.predicates_of(fn_def_id).instantiate_identity(tcx).predicates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// edition:2021
|
// edition:2021
|
||||||
// check-pass
|
// check-pass
|
||||||
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
||||||
|
// revisions: current next
|
||||||
|
|
||||||
#![feature(async_fn_in_trait)]
|
#![feature(async_fn_in_trait)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue