diff --git a/src/terminator/intrinsic.rs b/src/terminator/intrinsic.rs index f6ef46ecbfb8..8ede9fa7559b 100644 --- a/src/terminator/intrinsic.rs +++ b/src/terminator/intrinsic.rs @@ -424,9 +424,10 @@ pub(super) fn call_intrinsic( let ty_align = self.type_align(ty)?; let val_byte = self.value_to_primval(arg_vals[1], u8)?.to_u128()? as u8; let size = self.type_size(ty)?.expect("write_bytes() type must be sized"); - let ptr = arg_vals[0].read_ptr(&self.memory)?.to_ptr()?; + let ptr = arg_vals[0].read_ptr(&self.memory)?; let count = self.value_to_primval(arg_vals[2], usize)?.to_u64()?; if count > 0 { + let ptr = ptr.to_ptr()?; self.memory.check_align(ptr, ty_align, size * count)?; self.memory.write_repeat(ptr, val_byte, size * count)?; } diff --git a/tests/run-pass/hashmap.rs b/tests/run-pass-fullmir/hashmap.rs similarity index 73% rename from tests/run-pass/hashmap.rs rename to tests/run-pass-fullmir/hashmap.rs index 775dee252f62..c0c396240733 100644 --- a/tests/run-pass/hashmap.rs +++ b/tests/run-pass-fullmir/hashmap.rs @@ -1,10 +1,6 @@ use std::collections::{self, HashMap}; use std::hash::BuildHasherDefault; -// This disables the test completely: -// ignore-stage1 -// TODO: The tests actually passes against rustc and miri with MIR-libstd, but right now, we cannot express that in the test flags - fn main() { let map : HashMap> = Default::default(); assert_eq!(map.values().fold(0, |x, y| x+y), 0);