]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/zst_slice.rs
Rollup merge of #101555 - jhpratt:stabilize-mixed_integer_ops, r=joshtriplett
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / zst_slice.rs
1 //@compile-flags: -Zmiri-strict-provenance
2 //@error-pattern: /retag .* tag does not exist in the borrow stack/
3
4 fn main() {
5     unsafe {
6         let a = [1, 2, 3];
7         let s = &a[0..0];
8         assert_eq!(s.len(), 0);
9         assert_eq!(*s.get_unchecked(1), 2);
10     }
11 }