Skip to content

Commit 0a13718

Browse files
committed
fix miri tests
1 parent 6ebc8f3 commit 0a13718

File tree

7 files changed

+8
-1
lines changed

7 files changed

+8
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(redundant_transmutation)]
12
fn main() {
23
let _b = unsafe { std::mem::transmute::<u8, bool>(2) }; //~ ERROR: expected a boolean
34
}

src/tools/miri/tests/fail/validity/invalid_bool_op.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Make sure we find these even with many checks disabled.
33
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
44

5+
#![allow(redundant_transmutation)]
56
fn main() {
67
let b = unsafe { std::mem::transmute::<u8, bool>(2) };
78
let _x = b == std::hint::black_box(true); //~ ERROR: interpreting an invalid 8-bit value as a bool

src/tools/miri/tests/fail/validity/invalid_char.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(redundant_transmutation)]
12
fn main() {
23
assert!(std::char::from_u32(-1_i32 as u32).is_none());
34
let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } {

src/tools/miri/tests/fail/validity/invalid_char_op.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Make sure we find these even with many checks disabled.
33
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
44

5+
#![allow(redundant_transmutation)]
56
fn main() {
67
let c = 0xFFFFFFu32;
78
assert!(std::char::from_u32(c).is_none());

src/tools/miri/tests/pass/float.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#![feature(f128)]
66
#![feature(f16)]
77
#![allow(arithmetic_overflow)]
8-
#![allow(internal_features, redundant_transmutation)]
8+
#![allow(internal_features)]
9+
#![allow(redundant_transmutation)]
910

1011
use std::any::type_name;
1112
use std::cmp::min;

src/tools/miri/tests/pass/issues/issue-miri-184.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(redundant_transmutation)]
12
pub fn main() {
23
let bytes: [u8; 8] = unsafe { ::std::mem::transmute(0u64) };
34
let _val: &[u8] = &bytes;

src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// We're testing x86 target specific features
22
//@only-target: x86_64 i686
3+
#![allow(redundant_transmutation)]
34

45
#[cfg(target_arch = "x86")]
56
use std::arch::x86::*;

0 commit comments

Comments
 (0)