summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-21 23:20:04 +0000
committerbors <bors@rust-lang.org>2022-12-21 23:20:04 +0000
commitbdbe392a13bc9782b98de193c3751b9d96bb5fcc (patch)
tree860c50e7741ae8896129546d16d0a65956364b33 /compiler/rustc_const_eval/src/interpret
parentb569c9dc57ee22b6ff94563af856909763dfa24b (diff)
parent6f21ba4a06b7fa17113b7029c4aa7805db16aa32 (diff)
downloadrust-bdbe392a13bc9782b98de193c3751b9d96bb5fcc.tar.gz
rust-bdbe392a13bc9782b98de193c3751b9d96bb5fcc.zip
Auto merge of #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 #100423 lands so removing it may be a bit over eager.

r? `@RalfJung`
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/intrinsics.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
index 9b56757eb39..d4c99af43c3 100644
--- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
@@ -428,7 +428,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             sym::transmute => {
                 self.copy_op(&args[0], dest, /*allow_transmute*/ true)?;
             }
-            sym::assert_inhabited | sym::assert_zero_valid | sym::assert_uninit_valid => {
+            sym::assert_inhabited
+            | sym::assert_zero_valid
+            | sym::assert_mem_uninitialized_valid => {
                 let ty = instance.substs.type_at(0);
                 let layout = self.layout_of(ty)?;
 
@@ -460,7 +462,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                     }
                 }
 
-                if intrinsic_name == sym::assert_uninit_valid {
+                if intrinsic_name == sym::assert_mem_uninitialized_valid {
                     let should_panic = !self.tcx.permits_uninit_init(layout);
 
                     if should_panic {