Skip to content

Commit

Permalink
add known-bug test for unsoundness issue #107975
Browse files Browse the repository at this point in the history
Part of the resolution to #105107
  • Loading branch information
gburgessiv committed Feb 25, 2023
1 parent 60ac309 commit 7d83d69
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 7d83d69

Please sign in to comment.