diff options
| author | bors <bors@rust-lang.org> | 2023-03-22 21:35:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-03-22 21:35:02 +0000 |
| commit | 8859fde21fa4e059c71a843cc7ee995c189a97c0 (patch) | |
| tree | e4667bdecb090c73393e8b3ca4dfded439d8dc5f /compiler/rustc_ty_utils/src | |
| parent | a266f11990d9544ee408e213e1eec8cc9eb032b7 (diff) | |
| parent | 6244b94377a77d9caf84f6a8f4e375ae4e672465 (diff) | |
| download | rust-8859fde21fa4e059c71a843cc7ee995c189a97c0.tar.gz rust-8859fde21fa4e059c71a843cc7ee995c189a97c0.zip | |
Auto merge of #109497 - matthiaskrgr:rollup-6txuxm0, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #109373 (Set LLVM `LLVM_UNREACHABLE_OPTIMIZE` to `OFF`) - #109392 (Custom MIR: Allow optional RET type annotation) - #109394 (adapt tests/codegen/vec-shrink-panik for LLVM 17) - #109412 (rustdoc: Add GUI test for "Auto-hide item contents for large items" setting) - #109452 (Ignore the vendor directory for tidy tests.) - #109457 (Remove comment about reusing rib allocations) - #109461 (rustdoc: remove redundant `.content` prefix from span/a colors) - #109477 (`HirId` to `LocalDefId` cleanup) - #109489 (More general captures) - #109494 (Do not feed param_env for RPITITs impl side) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/assoc.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_ty_utils/src/assoc.rs b/compiler/rustc_ty_utils/src/assoc.rs index 562f5bffba3..bf0bc202852 100644 --- a/compiler/rustc_ty_utils/src/assoc.rs +++ b/compiler/rustc_ty_utils/src/assoc.rs @@ -386,10 +386,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() }), }); - // 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. impl_assoc_ty.visibility(tcx.visibility(impl_fn_def_id)); diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index 70686eefbca..50aeb7f440f 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -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; } |
