Skip to content

Commit 83b0c12

Browse files
committed
Auto merge of #3894 - rust-lang:rustup-2024-09-17, r=RalfJung
Automatic Rustup
2 parents 07fa008 + a0f7c35 commit 83b0c12

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c16ff44537509ca911ffd3653b17c6187c71831d
1+
e2dc1a1c0f97a90319181a721ab317210307617a

src/eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub fn create_ecx<'tcx>(
277277
config: &MiriConfig,
278278
) -> InterpResult<'tcx, InterpCx<'tcx, MiriMachine<'tcx>>> {
279279
let param_env = ty::ParamEnv::reveal_all();
280-
let layout_cx = LayoutCx { tcx, param_env };
280+
let layout_cx = LayoutCx::new(tcx, param_env);
281281
let mut ecx =
282282
InterpCx::new(tcx, rustc_span::DUMMY_SP, param_env, MiriMachine::new(config, layout_cx));
283283

src/machine.rs

+8-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rustc_middle::{
2121
query::TyCtxtAt,
2222
ty::{
2323
self,
24-
layout::{LayoutCx, LayoutError, LayoutOf, TyAndLayout},
24+
layout::{HasTyCtxt, LayoutCx, LayoutError, LayoutOf, TyAndLayout},
2525
Instance, Ty, TyCtxt,
2626
},
2727
};
@@ -381,8 +381,8 @@ pub struct PrimitiveLayouts<'tcx> {
381381
}
382382

383383
impl<'tcx> PrimitiveLayouts<'tcx> {
384-
fn new(layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, &'tcx LayoutError<'tcx>> {
385-
let tcx = layout_cx.tcx;
384+
fn new(layout_cx: LayoutCx<'tcx>) -> Result<Self, &'tcx LayoutError<'tcx>> {
385+
let tcx = layout_cx.tcx();
386386
let mut_raw_ptr = Ty::new_mut_ptr(tcx, tcx.types.unit);
387387
let const_raw_ptr = Ty::new_imm_ptr(tcx, tcx.types.unit);
388388
Ok(Self {
@@ -596,19 +596,14 @@ pub struct MiriMachine<'tcx> {
596596
}
597597

598598
impl<'tcx> MiriMachine<'tcx> {
599-
pub(crate) fn new(config: &MiriConfig, layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Self {
600-
let tcx = layout_cx.tcx;
599+
pub(crate) fn new(config: &MiriConfig, layout_cx: LayoutCx<'tcx>) -> Self {
600+
let tcx = layout_cx.tcx();
601601
let local_crates = helpers::get_local_crates(tcx);
602602
let layouts =
603603
PrimitiveLayouts::new(layout_cx).expect("Couldn't get layouts of primitive types");
604604
let profiler = config.measureme_out.as_ref().map(|out| {
605-
let crate_name = layout_cx
606-
.tcx
607-
.sess
608-
.opts
609-
.crate_name
610-
.clone()
611-
.unwrap_or_else(|| "unknown-crate".to_string());
605+
let crate_name =
606+
tcx.sess.opts.crate_name.clone().unwrap_or_else(|| "unknown-crate".to_string());
612607
let pid = process::id();
613608
// We adopt the same naming scheme for the profiler output that rustc uses. In rustc,
614609
// the PID is padded so that the nondeterministic value of the PID does not spread
@@ -701,7 +696,7 @@ impl<'tcx> MiriMachine<'tcx> {
701696
clock: Clock::new(config.isolated_op == IsolatedOp::Allow),
702697
#[cfg(unix)]
703698
native_lib: config.native_lib.as_ref().map(|lib_file_path| {
704-
let target_triple = layout_cx.tcx.sess.opts.target_triple.triple();
699+
let target_triple = tcx.sess.opts.target_triple.triple();
705700
// Check if host target == the session target.
706701
if env!("TARGET") != target_triple {
707702
panic!(

0 commit comments

Comments
 (0)