Skip to content

Commit 13c6bc6

Browse files
committed
Auto merge of #143434 - matthiaskrgr:rollup-eyr4rcb, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang/rust#140643 (Refactor StableMIR) - rust-lang/rust#143286 (Make -Ztrack-diagnostics emit like a note) - rust-lang/rust#143308 (Remove `PointerLike` trait) - rust-lang/rust#143387 (Make __rust_alloc_error_handler_should_panic a function) - rust-lang/rust#143400 (Port `#[rustc_pass_by_value]` to the new attribute system) - rust-lang/rust#143417 (bump termize dep) - rust-lang/rust#143420 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e47e133 + fed9daa commit 13c6bc6

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

src/shims/extern_static.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Provides the `extern static` that this platform expects.
22
3-
use rustc_symbol_mangling::mangle_internal_symbol;
4-
53
use crate::*;
64

75
impl<'tcx> MiriMachine<'tcx> {
@@ -45,15 +43,6 @@ impl<'tcx> MiriMachine<'tcx> {
4543

4644
/// Sets up the "extern statics" for this machine.
4745
pub fn init_extern_statics(ecx: &mut MiriInterpCx<'tcx>) -> InterpResult<'tcx> {
48-
// "__rust_alloc_error_handler_should_panic"
49-
let val = ecx.tcx.sess.opts.unstable_opts.oom.should_panic();
50-
let val = ImmTy::from_int(val, ecx.machine.layouts.u8);
51-
Self::alloc_extern_static(
52-
ecx,
53-
&mangle_internal_symbol(*ecx.tcx, "__rust_alloc_error_handler_should_panic"),
54-
val,
55-
)?;
56-
5746
if ecx.target_os_is_unix() {
5847
// "environ" is mandated by POSIX.
5948
let environ = ecx.machine.env_vars.unix().environ();

src/shims/foreign_items.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,12 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
615615
// This is a no-op shim that only exists to prevent making the allocator shims instantly stable.
616616
let [] = this.check_shim(abi, CanonAbi::Rust, link_name, args)?;
617617
}
618+
name if name == this.mangle_internal_symbol("__rust_alloc_error_handler_should_panic_v2") => {
619+
// Gets the value of the `oom` option.
620+
let [] = this.check_shim(abi, CanonAbi::Rust, link_name, args)?;
621+
let val = this.tcx.sess.opts.unstable_opts.oom.should_panic();
622+
this.write_int(val, dest)?;
623+
}
618624

619625
// C memory handling functions
620626
"memcmp" => {

tests/pass/alloc-access-tracking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_std]
22
#![no_main]
3-
//@compile-flags: -Zmiri-track-alloc-id=19 -Zmiri-track-alloc-accesses -Cpanic=abort
4-
//@normalize-stderr-test: "id 19" -> "id $$ALLOC"
3+
//@compile-flags: -Zmiri-track-alloc-id=18 -Zmiri-track-alloc-accesses -Cpanic=abort
4+
//@normalize-stderr-test: "id 18" -> "id $$ALLOC"
55
//@only-target: linux # alloc IDs differ between OSes (due to extern static allocations)
66

77
extern "Rust" {

0 commit comments

Comments
 (0)