diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2023-06-22 17:44:44 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2023-06-29 14:04:29 -0300 |
| commit | 33d21e62d070e11385cb223c60519c0fb267a432 (patch) | |
| tree | 8776e7dab06d89240c9f891cf149d1465d5b0f4e | |
| parent | 373293c3ca0a86dfd00df298be75a87ed414f99c (diff) | |
| download | rust-33d21e62d070e11385cb223c60519c0fb267a432.tar.gz rust-33d21e62d070e11385cb223c60519c0fb267a432.zip | |
Do not remove previously added predicates in param_env, extend them instead
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index 2daab520a2f..2b391f94a63 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -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 |
