Skip to content

Commit 33d21e6

Browse files
committed
Do not remove previously added predicates in param_env, extend them instead
1 parent 373293c commit 33d21e6

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_ty_utils/src

1 file changed

+3
-1
lines changed

compiler/rustc_ty_utils/src/ty.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
131131
if let Some(ImplTraitInTraitData::Trait { fn_def_id, .. })
132132
| Some(ImplTraitInTraitData::Impl { fn_def_id, .. }) = tcx.opt_rpitit_info(def_id)
133133
{
134-
predicates = tcx.predicates_of(fn_def_id).instantiate_identity(tcx).predicates;
134+
// FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty): Should not need to add the predicates
135+
// from the parent fn to our assumptions
136+
predicates.extend(tcx.predicates_of(fn_def_id).instantiate_identity(tcx).predicates);
135137
}
136138

137139
// Finally, we have to normalize the bounds in the environment, in

0 commit comments

Comments
 (0)