Skip to content

Commit

Permalink
Auto merge of #1712 - RalfJung:rustup, r=RalfJung
Browse files Browse the repository at this point in the history
Rustup

Fixes #1706
Cc #1711 for the temporarily disabled tests
  • Loading branch information
bors committed Feb 16, 2021
2 parents b5b5df5 + ebd037b commit e14fbfd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bb587b1a1737738658d2eaecd4c8c1cab555257a
42a4673fbd40b09a99d057eaa9b3e5579b54c184
14 changes: 14 additions & 0 deletions tests/compile-fail/branchless-select-i128-pointer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use std::mem::transmute;
fn main() {
for &my_bool in &[true, false] {
let mask = -(my_bool as i128); // false -> 0, true -> -1 aka !0
// This is branchless code to select one or the other pointer.
// For now, Miri brafs on it, but if this code ever passes we better make sure it behaves correctly.
let val = unsafe {
transmute::<_, &str>(
!mask & transmute::<_, i128>("false !") | mask & transmute::<_, i128>("true !"), //~ERROR encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes
)
};
println!("{}", val);
}
}
1 change: 1 addition & 0 deletions tests/compile-fail/validity/execute_memory.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ignore-test FIXME (Miri issue #1711)
#![feature(box_syntax)]

fn main() {
Expand Down
1 change: 1 addition & 0 deletions tests/compile-fail/validity/invalid_fnptr_uninit.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ignore-test FIXME (Miri issue #1711)
#![allow(invalid_value)]

union MyUninit {
Expand Down

0 comments on commit e14fbfd

Please sign in to comment.