]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/unescaped_static.rs
Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyup
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / unescaped_static.rs
1 static ARRAY: [u8; 2] = [0, 1];
2
3 fn main() {
4     let ptr_to_first = &ARRAY[0] as *const u8;
5     // Illegally use this to access the 2nd element.
6     let _val = unsafe { *ptr_to_first.add(1) }; //~ ERROR: /read access .* tag does not exist in the borrow stack/
7 }