]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr
Bless tests
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / drop_in_place_retag.stderr
1 error: Undefined Behavior: trying to retag from <TAG> for Unique permission at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location
2   --> RUSTLIB/core/src/ptr/mod.rs:LL:CC
3    |
4 LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    | |
7    | trying to retag from <TAG> for Unique permission at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location
8    | this error occurs as part of retag at ALLOC[0x0..0x1]
9    |
10    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
11    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
12 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x1]
13   --> $DIR/drop_in_place_retag.rs:LL:CC
14    |
15 LL |         let x = core::ptr::addr_of!(x);
16    |                 ^^^^^^^^^^^^^^^^^^^^^^
17    = note: BACKTRACE:
18    = note: inside `std::ptr::drop_in_place::<u8> - shim(None)` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
19 note: inside `main`
20   --> $DIR/drop_in_place_retag.rs:LL:CC
21    |
22 LL |         core::ptr::drop_in_place(x.cast_mut());
23    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24    = note: this error originates in the macro `core::ptr::addr_of` (in Nightly builds, run with -Z macro-backtrace for more info)
25
26 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
27
28 error: aborting due to previous error
29