Skip to content

Commit e112151

Browse files
authored
Merge pull request #4040 from rust-lang/rustup-2024-11-19
Automatic Rustup
2 parents 3b48085 + 92b5420 commit e112151

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3fb7e441aecc3c054d71eb4d752d06e7776e8888
1+
b71fb5edc0217eaf8fc824a44cd7b0945e29ff4d

src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::{cmp, mem};
1212
use rustc_abi::{BackendRepr, Size};
1313
use rustc_data_structures::fx::FxHashSet;
1414
use rustc_middle::mir::{Mutability, RetagKind};
15-
use rustc_middle::ty::layout::HasParamEnv;
15+
use rustc_middle::ty::layout::HasTypingEnv;
1616
use rustc_middle::ty::{self, Ty};
1717

1818
use self::diagnostics::{RetagCause, RetagInfo};

src/borrow_tracker/tree_borrows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc_abi::{BackendRepr, Size};
22
use rustc_middle::mir::{Mutability, RetagKind};
3-
use rustc_middle::ty::layout::HasParamEnv;
3+
use rustc_middle::ty::layout::HasTypingEnv;
44
use rustc_middle::ty::{self, Ty};
55
use rustc_span::def_id::DefId;
66

src/eval.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,14 @@ pub fn create_ecx<'tcx>(
268268
entry_type: EntryFnType,
269269
config: &MiriConfig,
270270
) -> InterpResult<'tcx, InterpCx<'tcx, MiriMachine<'tcx>>> {
271-
let param_env = ty::ParamEnv::reveal_all();
272-
let layout_cx = LayoutCx::new(tcx, param_env);
273-
let mut ecx =
274-
InterpCx::new(tcx, rustc_span::DUMMY_SP, param_env, MiriMachine::new(config, layout_cx));
271+
let typing_env = ty::TypingEnv::fully_monomorphized();
272+
let layout_cx = LayoutCx::new(tcx, typing_env);
273+
let mut ecx = InterpCx::new(
274+
tcx,
275+
rustc_span::DUMMY_SP,
276+
typing_env.param_env,
277+
MiriMachine::new(config, layout_cx),
278+
);
275279

276280
// Some parts of initialization require a full `InterpCx`.
277281
MiriMachine::late_init(&mut ecx, config, {
@@ -376,7 +380,7 @@ pub fn create_ecx<'tcx>(
376380
let main_ret_ty = main_ret_ty.no_bound_vars().unwrap();
377381
let start_instance = ty::Instance::try_resolve(
378382
tcx,
379-
ty::ParamEnv::reveal_all(),
383+
typing_env,
380384
start_id,
381385
tcx.mk_args(&[ty::GenericArg::from(main_ret_ty)]),
382386
)

src/helpers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ pub fn resolve_path<'tcx>(
116116
/// Gets the layout of a type at a path.
117117
#[track_caller]
118118
pub fn path_ty_layout<'tcx>(cx: &impl LayoutOf<'tcx>, path: &[&str]) -> TyAndLayout<'tcx> {
119-
let ty =
120-
resolve_path(cx.tcx(), path, Namespace::TypeNS).ty(cx.tcx(), ty::ParamEnv::reveal_all());
119+
let ty = resolve_path(cx.tcx(), path, Namespace::TypeNS).ty(cx.tcx(), cx.typing_env());
121120
cx.layout_of(ty).to_result().ok().unwrap()
122121
}
123122

src/machine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,8 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
11271127
};
11281128
let info = ecx.get_alloc_info(alloc_id);
11291129
let def_ty = ecx.tcx.type_of(def_id).instantiate_identity();
1130-
let extern_decl_layout = ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
1130+
let extern_decl_layout =
1131+
ecx.tcx.layout_of(ecx.typing_env().as_query_input(def_ty)).unwrap();
11311132
if extern_decl_layout.size != info.size || extern_decl_layout.align.abi != info.align {
11321133
throw_unsup_format!(
11331134
"extern static `{link_name}` has been declared as `{krate}::{name}` \

0 commit comments

Comments
 (0)