diff options
| author | bors <bors@rust-lang.org> | 2021-01-16 17:28:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-16 17:28:32 +0000 |
| commit | 492b83c6971c390af7a42932869502224ef55ef7 (patch) | |
| tree | b22aa973076eecca1884744222e0bbf98ee596c7 /src/test/codegen | |
| parent | 63a83c5f55801b17b77adf690db397d17c706c48 (diff) | |
| parent | a5b89a00cb2871719868cbca5af14e6cf185060a (diff) | |
| download | rust-492b83c6971c390af7a42932869502224ef55ef7.tar.gz rust-492b83c6971c390af7a42932869502224ef55ef7.zip | |
Auto merge of #80290 - RalfJung:less-intrinsic-write, r=lcnr
implement ptr::write without dedicated intrinsic This makes `ptr::write` more consistent with `ptr::write_unaligned`, `ptr::read`, `ptr::read_unaligned`, all of which are implemented in terms of `copy_nonoverlapping`. This means we can also remove `move_val_init` implementations in codegen and Miri, and its special handling in the borrow checker. Also see [this Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/ptr.3A.3Aread.20vs.20ptr.3A.3Awrite).
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/intrinsics/move-val-init.rs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/test/codegen/intrinsics/move-val-init.rs b/src/test/codegen/intrinsics/move-val-init.rs deleted file mode 100644 index 6222536b506..00000000000 --- a/src/test/codegen/intrinsics/move-val-init.rs +++ /dev/null @@ -1,19 +0,0 @@ -// compile-flags: -C no-prepopulate-passes - -#![feature(core_intrinsics)] -#![crate_type = "lib"] - -// test that `move_val_init` actually avoids big allocas - -use std::intrinsics::move_val_init; - -pub struct Big { - pub data: [u8; 65536] -} - -// CHECK-LABEL: @test_mvi -#[no_mangle] -pub unsafe fn test_mvi(target: *mut Big, make_big: fn() -> Big) { - // CHECK: call void %make_big(%Big*{{[^%]*}} %target) - move_val_init(target, make_big()); -} |
