Skip to content

Commit dd151be

Browse files
committed
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.
1 parent d71ed8d commit dd151be

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ fn main() {
5555
// The `Box` has been deallocated by now, so this is a dangling reference!
5656
let r: &u8 = &*r;
5757
println!("{:p}", r);
58+
println!("{}", i);
5859

5960
// The following might segfault. Or it might not.
6061
// Depends on the platform semantics

tests/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ fn main() {
5858
// The `Box` has been deallocated by now, so this is a dangling reference!
5959
let r: &u8 = &*r;
6060
println!("{:p}", r);
61+
println!("{}", i);
6162

6263
// The following might segfault. Or it might not.
6364
// Depends on the platform semantics

tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ fn main() {
5858
// The `Box` has been deallocated by now, so this is a dangling reference!
5959
let r: &u8 = &*r;
6060
println!("{:p}", r);
61+
println!("{}", i);
6162

6263
// The following might segfault. Or it might not.
6364
// Depends on the platform semantics

0 commit comments

Comments
 (0)