Skip to content

Commit e14fbfd

Browse files
committed
Auto merge of #1712 - RalfJung:rustup, r=RalfJung
Rustup Fixes #1706 Cc #1711 for the temporarily disabled tests
2 parents b5b5df5 + ebd037b commit e14fbfd

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bb587b1a1737738658d2eaecd4c8c1cab555257a
1+
42a4673fbd40b09a99d057eaa9b3e5579b54c184
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use std::mem::transmute;
2+
fn main() {
3+
for &my_bool in &[true, false] {
4+
let mask = -(my_bool as i128); // false -> 0, true -> -1 aka !0
5+
// This is branchless code to select one or the other pointer.
6+
// For now, Miri brafs on it, but if this code ever passes we better make sure it behaves correctly.
7+
let val = unsafe {
8+
transmute::<_, &str>(
9+
!mask & transmute::<_, i128>("false !") | mask & transmute::<_, i128>("true !"), //~ERROR encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes
10+
)
11+
};
12+
println!("{}", val);
13+
}
14+
}

tests/compile-fail/validity/execute_memory.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore-test FIXME (Miri issue #1711)
12
#![feature(box_syntax)]
23

34
fn main() {

tests/compile-fail/validity/invalid_fnptr_uninit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore-test FIXME (Miri issue #1711)
12
#![allow(invalid_value)]
23

34
union MyUninit {

0 commit comments

Comments
 (0)