mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
test HashMap creation in libstd-MIR, and make it work again
This commit is contained in:
@@ -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)?;
|
||||
}
|
||||
|
||||
@@ -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<String, i32, BuildHasherDefault<collections::hash_map::DefaultHasher>> = Default::default();
|
||||
assert_eq!(map.values().fold(0, |x, y| x+y), 0);
|
||||
Reference in New Issue
Block a user