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.
This commit is contained in:
Nikita Popov 2025-08-19 11:48:00 +02:00
parent d71ed8d19b
commit dd151beeb6
3 changed files with 3 additions and 0 deletions

View file

@ -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

View file

@ -58,6 +58,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

View file

@ -58,6 +58,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