Skip to content

Commit 7d83d69

Browse files
committed
add known-bug test for unsoundness issue rust-lang#107975
Part of the resolution to rust-lang#105107
1 parent 60ac309 commit 7d83d69

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// run-pass
2+
// known-bug: #107975
3+
fn main() {
4+
let a: *const u8;
5+
let b: *const u8;
6+
{
7+
let v: [u8; 16] = [core::hint::black_box(0); 16];
8+
a = &(v[0]);
9+
}
10+
{
11+
let v: [u8; 16] = [core::hint::black_box(0); 16];
12+
b = &(v[0]);
13+
}
14+
assert_ne!(a, b);
15+
println!("{a:?} {b:?}");
16+
assert_eq!(a, b);
17+
}

0 commit comments

Comments
 (0)