]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr
Rollup merge of #105459 - jyn514:proc-macro-default, r=Mark-Simulacrum
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / illegal_dealloc1.stderr
1 error: Undefined Behavior: attempting deallocation using <TAG> at ALLOC, but that tag does not exist in the borrow stack for this location
2   --> RUSTLIB/alloc/src/alloc.rs:LL:CC
3    |
4 LL |     unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
5    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempting deallocation using <TAG> at ALLOC, but that tag does not exist in the borrow stack for this location
6    |
7    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
8    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
9 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x1]
10   --> $DIR/illegal_deALLOC.rs:LL:CC
11    |
12 LL |         let ptr2 = (&mut *ptr1) as *mut u8;
13    |                    ^^^^^^^^^^^^
14 help: <TAG> was later invalidated at offsets [0x0..0x1] by a write access
15   --> $DIR/illegal_deALLOC.rs:LL:CC
16    |
17 LL |         ptr1.write(0);
18    |         ^^^^^^^^^^^^^
19    = note: BACKTRACE:
20    = note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
21 note: inside `main`
22   --> $DIR/illegal_deALLOC.rs:LL:CC
23    |
24 LL |         dealloc(ptr2, Layout::from_size_align_unchecked(1, 1));
25    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
27 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
28
29 error: aborting due to previous error
30