Skip to content

Commit

Permalink
add known-bug test for unsoundness issue rust-lang#107975
Browse files Browse the repository at this point in the history
Part of the resolution to rust-lang#105107
  • Loading branch information
gburgessiv authored and GrigorenkoPV committed Jun 26, 2024
1 parent 2fc136b commit 97fa7f0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/ui/codegen/issue-107975-pointer-inequality.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// run-pass
// known-bug: #107975
fn main() {
let a: *const u8;
let b: *const u8;
{
let v: [u8; 16] = [core::hint::black_box(0); 16];
a = &(v[0]);
}
{
let v: [u8; 16] = [core::hint::black_box(0); 16];
b = &(v[0]);
}
assert_ne!(a, b);
println!("{a:?} {b:?}");
assert_eq!(a, b);
}

0 comments on commit 97fa7f0

Please sign in to comment.