730cd27248
This tries to clarify exactly why an access is not valid by printing what memory range the access was over, which in combination with tag-tracking may help a user figure out the source of the problem.
12 lines
258 B
Rust
12 lines
258 B
Rust
// compile-flags: -Zmiri-tag-raw-pointers
|
|
// error-pattern: does not exist in the borrow stack
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let a = [1, 2, 3];
|
|
let s = &a[0..0];
|
|
assert_eq!(s.len(), 0);
|
|
assert_eq!(*s.get_unchecked(1), 2);
|
|
}
|
|
}
|