about summary refs log tree commit diff
path: root/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-08-19 11:48:00 +0200
committerNikita Popov <npopov@redhat.com>2025-08-20 19:08:16 +0200
commitdd151beeb6e3f5a42c8b3c4058cdd38c581ccc50 (patch)
tree9b58f1c33bfe941fb4f0908471a8e3725601cdd4 /tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs
parentd71ed8d19bcfdbd6eb3bf2620071f2ab95470a57 (diff)
downloadrust-dd151beeb6e3f5a42c8b3c4058cdd38c581ccc50.tar.gz
rust-dd151beeb6e3f5a42c8b3c4058cdd38c581ccc50.zip
Adjust test to still show miscompile
The capture of i in assert_ne!() is now known read-only, which
enables early SROA. Block this by passing i to println, where
we currently cannot recognize this.
Diffstat (limited to 'tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs')
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs
index 70cbb9a52f7..c69565a81f2 100644
--- a/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs
+++ b/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs
@@ -55,6 +55,7 @@ fn main() {
     // The `Box` has been deallocated by now, so this is a dangling reference!
     let r: &u8 = &*r;
     println!("{:p}", r);
+    println!("{}", i);
 
     // The following might segfault. Or it might not.
     // Depends on the platform semantics