Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b96610b

Browse files
committed
Auto merge of rust-lang#2135 - RalfJung:rustup, r=RalfJung
rustup
2 parents d419efd + 8b4d613 commit b96610b

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f24ef2e296ec6fc6fd2e24d7e4bfec3f4cb0577a
1+
22ee39504a702f75485582d02060495a01254de1

src/machine.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,12 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
470470
}
471471

472472
#[inline(always)]
473-
fn enforce_number_validity(ecx: &MiriEvalContext<'mir, 'tcx>) -> bool {
473+
fn enforce_number_init(ecx: &MiriEvalContext<'mir, 'tcx>) -> bool {
474+
ecx.machine.enforce_number_validity
475+
}
476+
477+
#[inline(always)]
478+
fn enforce_number_no_provenance(ecx: &MiriEvalContext<'mir, 'tcx>) -> bool {
474479
ecx.machine.enforce_number_validity
475480
}
476481

tests/compile-fail/ptr_integer_transmute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
fn main() {
44
let r = &mut 42;
5-
let _i: usize = unsafe { std::mem::transmute(r) }; //~ ERROR expected initialized plain (non-pointer) bytes
5+
let _i: usize = unsafe { std::mem::transmute(r) }; //~ ERROR expected plain (non-pointer) bytes
66
}

tests/compile-fail/strict_provenance_transmute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::mem;
77
// <https://github.com/rust-lang/unsafe-code-guidelines/issues/286#issuecomment-1085144431>.
88

99
unsafe fn deref(left: *const u8, right: *const u8) {
10-
let left_int: usize = mem::transmute(left); //~ERROR expected initialized plain (non-pointer) bytes
10+
let left_int: usize = mem::transmute(left); //~ERROR expected plain (non-pointer) bytes
1111
let right_int: usize = mem::transmute(right);
1212
if left_int == right_int {
1313
// The compiler is allowed to replace `left_int` by `right_int` here...

tests/compile-fail/uninit_float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
fn main() {
66
let _val = unsafe { std::mem::MaybeUninit::<f32>::uninit().assume_init() };
7-
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
7+
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes
88
}

tests/compile-fail/uninit_integer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
fn main() {
66
let _val = unsafe { std::mem::MaybeUninit::<usize>::uninit().assume_init() };
7-
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
7+
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes
88
}

tests/compile-fail/uninit_integer_signed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
fn main() {
66
let _val = unsafe { std::mem::MaybeUninit::<i32>::uninit().assume_init() };
7-
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
7+
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes
88
}

0 commit comments

Comments
 (0)