Implement write_via_move intrinsic for mir-eval

This commit is contained in:
Lukas Wirth 2023-09-06 21:49:16 +02:00
parent f29867bd26
commit f13b184eb3
2 changed files with 34 additions and 0 deletions

View file

@ -586,6 +586,24 @@ fn write_bytes() {
);
}
#[test]
fn write_via_move() {
check_number(
r#"
extern "rust-intrinsic" {
fn write_via_move<T>(ptr: *mut T, value: T);
}
const GOAL: i32 = unsafe {
let mut x = 2;
write_via_move(&mut x, 100);
x
};
"#,
100,
);
}
#[test]
fn copy() {
check_number(