diff --git a/src/machine.rs b/src/machine.rs index a2d9e9ced1a1..12df9e271fb9 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -169,7 +169,7 @@ impl Provenance for Tag { write!(f, "{:?}", sb)?; } Tag::Wildcard => { - write!(f, "[Wildcard]")?; + write!(f, "[wildcard]")?; } } diff --git a/src/shims/intrinsics.rs b/src/shims/intrinsics.rs index 9cf9461715f1..ab79438c734d 100644 --- a/src/shims/intrinsics.rs +++ b/src/shims/intrinsics.rs @@ -68,12 +68,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx "volatile_load" => { let [place] = check_arg_count(args)?; let place = this.deref_operand(place)?; - this.copy_op(&place.into(), dest)?; + this.copy_op(&place.into(), dest, /*allow_transmute*/ false)?; } "volatile_store" => { let [place, dest] = check_arg_count(args)?; let place = this.deref_operand(place)?; - this.copy_op(dest, &place.into())?; + this.copy_op(dest, &place.into(), /*allow_transmute*/ false)?; } "write_bytes" | "volatile_set_memory" => { diff --git a/tests/pass/transmute_fat.rs b/tests/pass/transmute_fat.rs index 1d2ec92a8038..b752e5504d4c 100644 --- a/tests/pass/transmute_fat.rs +++ b/tests/pass/transmute_fat.rs @@ -3,6 +3,7 @@ fn main() { // If we are careful, we can exploit data layout... + // This is a tricky case since we are transmuting a ScalarPair type to a non-ScalarPair type. let raw = unsafe { std::mem::transmute::<&[u8], [*const u8; 2]>(&[42]) }; let ptr: *const u8 = unsafe { std::mem::transmute_copy(&raw) }; assert_eq!(unsafe { *ptr }, 42);