Demo: https://rust.godbolt.org/z/MfWTbvxE8
struct Foo([u32; 4]);
#[unsafe(no_mangle)]
pub fn demo(p: *mut Foo, num: Foo) {
unsafe { std::intrinsics::unaligned_volatile_store(p, num) }
}
On rustc 1.99.0-nightly (3659db0 2026-07-05)
define void @demo(ptr noundef %p, ptr dead_on_return noalias nofree noundef align 4 captures(address) dereferenceable(16) %num) unnamed_addr {
start:
call void @llvm.memcpy.p0.p0.i64(ptr align 4 %p, ptr align 4 %num, i64 16, i1 true)
; ^^^^^^^ ^^^^^^^
ret void
}
Thankfully this intrinsic is so unstable it doesn't even have an unstable wrapper in the library.
Demo: https://rust.godbolt.org/z/MfWTbvxE8
On rustc 1.99.0-nightly (3659db0 2026-07-05)
Thankfully this intrinsic is so unstable it doesn't even have an unstable wrapper in the library.