Skip to content

Commit 928d656

Browse files
committed
Auto merge of rust-lang#105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJung
Rename `assert_uninit_valid` intrinsic It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that. This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if rust-lang#100423 lands so removing it may be a bit over eager. r? `@RalfJung`
2 parents 98a276b + 67b711a commit 928d656

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/intrinsics/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
644644
let res = CValue::by_val(res, arg.layout());
645645
ret.write_cvalue(fx, res);
646646
}
647-
sym::assert_inhabited | sym::assert_zero_valid | sym::assert_uninit_valid => {
647+
sym::assert_inhabited | sym::assert_zero_valid | sym::assert_mem_uninitialized_valid => {
648648
intrinsic_args!(fx, args => (); intrinsic);
649649

650650
let layout = fx.layout_of(substs.type_at(0));
@@ -673,7 +673,9 @@ fn codegen_regular_intrinsic_call<'tcx>(
673673
return;
674674
}
675675

676-
if intrinsic == sym::assert_uninit_valid && !fx.tcx.permits_uninit_init(layout) {
676+
if intrinsic == sym::assert_mem_uninitialized_valid
677+
&& !fx.tcx.permits_uninit_init(layout)
678+
{
677679
with_no_trimmed_paths!({
678680
crate::base::codegen_panic(
679681
fx,

0 commit comments

Comments
 (0)