diff options
| author | bors <bors@rust-lang.org> | 2024-02-13 00:31:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-13 00:31:53 +0000 |
| commit | 0a5b998c57a8681acc13206b5917340b053b3a30 (patch) | |
| tree | d673efacffd4baf86b67a6d9e2e511a1d2db8888 /compiler/rustc_const_eval/src/interpret/eval_context.rs | |
| parent | 74c3f5a146860c94ff4d179fc3bfa34f879adf41 (diff) | |
| parent | 8a87cdacb15d4856e60388d456449158e3f542b6 (diff) | |
| download | rust-0a5b998c57a8681acc13206b5917340b053b3a30.tar.gz rust-0a5b998c57a8681acc13206b5917340b053b3a30.zip | |
Auto merge of #120991 - matthiaskrgr:rollup-f8kw2st, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #118983 (Warn on references casting to bigger memory layout) - #119451 (Gate PR CI on clippy correctness lints) - #120273 (compiletest: few naive improvements) - #120950 (Fix async closures in CTFE) - #120958 (Dejargonize `subst`) - #120965 (Add lahfsahf and prfchw target feature) - #120970 (add another test for promoteds-in-static) - #120979 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/eval_context.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/eval_context.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index ff90059203a..33e96e7faa8 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -554,18 +554,20 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { /// Call this on things you got out of the MIR (so it is as generic as the current /// stack frame), to bring it into the proper environment for this interpreter. - pub(super) fn subst_from_current_frame_and_normalize_erasing_regions< + pub(super) fn instantiate_from_current_frame_and_normalize_erasing_regions< T: TypeFoldable<TyCtxt<'tcx>>, >( &self, value: T, ) -> Result<T, ErrorHandled> { - self.subst_from_frame_and_normalize_erasing_regions(self.frame(), value) + self.instantiate_from_frame_and_normalize_erasing_regions(self.frame(), value) } /// Call this on things you got out of the MIR (so it is as generic as the provided /// stack frame), to bring it into the proper environment for this interpreter. - pub(super) fn subst_from_frame_and_normalize_erasing_regions<T: TypeFoldable<TyCtxt<'tcx>>>( + pub(super) fn instantiate_from_frame_and_normalize_erasing_regions< + T: TypeFoldable<TyCtxt<'tcx>>, + >( &self, frame: &Frame<'mir, 'tcx, M::Provenance, M::FrameExtra>, value: T, @@ -656,7 +658,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let layout = from_known_layout(self.tcx, self.param_env, layout, || { let local_ty = frame.body.local_decls[local].ty; - let local_ty = self.subst_from_frame_and_normalize_erasing_regions(frame, local_ty)?; + let local_ty = + self.instantiate_from_frame_and_normalize_erasing_regions(frame, local_ty)?; self.layout_of(local_ty) })?; @@ -791,8 +794,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { // Make sure all the constants required by this frame evaluate successfully (post-monomorphization check). if M::POST_MONO_CHECKS { for &const_ in &body.required_consts { - let c = - self.subst_from_current_frame_and_normalize_erasing_regions(const_.const_)?; + let c = self + .instantiate_from_current_frame_and_normalize_erasing_regions(const_.const_)?; c.eval(*self.tcx, self.param_env, Some(const_.span)).map_err(|err| { err.emit_note(*self.tcx); err |
