Skip to content

Commit 1e469e3

Browse files
committed
Merge from rust-lang/rust
2 parents b38bbad + a719071 commit 1e469e3

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/shims/extern_static.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ impl<'tcx> MiriMachine<'tcx> {
4545

4646
/// Sets up the "extern statics" for this machine.
4747
pub fn init_extern_statics(ecx: &mut MiriInterpCx<'tcx>) -> InterpResult<'tcx> {
48-
// "__rust_no_alloc_shim_is_unstable"
49-
let val = ImmTy::from_int(0, ecx.machine.layouts.u8); // always 0, value does not matter
50-
Self::alloc_extern_static(ecx, "__rust_no_alloc_shim_is_unstable", val)?;
51-
5248
// "__rust_alloc_error_handler_should_panic"
5349
let val = ecx.tcx.sess.opts.unstable_opts.oom.should_panic();
5450
let val = ImmTy::from_int(val, ecx.machine.layouts.u8);

src/shims/foreign_items.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,10 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
611611
this.write_pointer(new_ptr, dest)
612612
});
613613
}
614+
name if name == this.mangle_internal_symbol("__rust_no_alloc_shim_is_unstable_v2") => {
615+
// This is a no-op shim that only exists to prevent making the allocator shims instantly stable.
616+
let [] = this.check_shim(abi, CanonAbi::Rust, link_name, args)?;
617+
}
614618

615619
// C memory handling functions
616620
"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=20 -Zmiri-track-alloc-accesses -Cpanic=abort
4-
//@normalize-stderr-test: "id 20" -> "id $$ALLOC"
3+
//@compile-flags: -Zmiri-track-alloc-id=19 -Zmiri-track-alloc-accesses -Cpanic=abort
4+
//@normalize-stderr-test: "id 19" -> "id $$ALLOC"
55
//@only-target: linux # alloc IDs differ between OSes (due to extern static allocations)
66

77
extern "Rust" {

tests/pass/fn_align.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
//@compile-flags: -Zmin-function-alignment=8
22
#![feature(fn_align)]
33

4-
// When a function uses `repr(align(N))`, the function address should be a multiple of `N`.
4+
// When a function uses `align(N)`, the function address should be a multiple of `N`.
55

6-
#[repr(align(256))]
6+
#[align(256)]
77
fn foo() {}
88

9-
#[repr(align(16))]
9+
#[align(16)]
1010
fn bar() {}
1111

12-
#[repr(align(4))]
12+
#[align(4)]
1313
fn baz() {}
1414

1515
fn main() {
1616
assert!((foo as usize).is_multiple_of(256));
1717
assert!((bar as usize).is_multiple_of(16));
1818

19-
// The maximum of `repr(align(N))` and `-Zmin-function-alignment=N` is used.
19+
// The maximum of `align(N)` and `-Zmin-function-alignment=N` is used.
2020
assert!((baz as usize).is_multiple_of(8));
2121
}

0 commit comments

Comments
 (0)