|
| 1 | +error: Undefined Behavior: deallocating while item is protected: [SharedReadWrite for <TAG> (call ID)] |
| 2 | + --> RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 3 | + | |
| 4 | +LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) } |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating while item is protected: [SharedReadWrite for <TAG> (call ID)] |
| 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 | + |
| 10 | + = note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 11 | + = note: inside `<std::alloc::Global as std::alloc::Allocator>::deallocate` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 12 | + = note: inside `alloc::alloc::box_free::<NotUnpin, std::alloc::Global>` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 13 | + = note: inside `std::ptr::drop_in_place::<std::boxed::Box<NotUnpin>> - shim(Some(std::boxed::Box<NotUnpin>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC |
| 14 | + = note: inside `std::mem::drop::<std::boxed::Box<NotUnpin>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC |
| 15 | +note: inside closure at $DIR/deallocate_against_barrier2.rs:LL:CC |
| 16 | + --> $DIR/deallocate_against_barrier2.rs:LL:CC |
| 17 | + | |
| 18 | +LL | drop(unsafe { Box::from_raw(raw) }); |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 20 | + = note: inside `<[closure@$DIR/deallocate_against_barrier2.rs:LL:CC] as std::ops::FnOnce<(&mut NotUnpin,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC |
| 21 | +note: inside `inner` at $DIR/deallocate_against_barrier2.rs:LL:CC |
| 22 | + --> $DIR/deallocate_against_barrier2.rs:LL:CC |
| 23 | + | |
| 24 | +LL | f(x) |
| 25 | + | ^^^^ |
| 26 | +note: inside `main` at $DIR/deallocate_against_barrier2.rs:LL:CC |
| 27 | + --> $DIR/deallocate_against_barrier2.rs:LL:CC |
| 28 | + | |
| 29 | +LL | / inner(Box::leak(Box::new(NotUnpin(0, PhantomPinned))), |x| { |
| 30 | +LL | | let raw = x as *mut _; |
| 31 | +LL | | drop(unsafe { Box::from_raw(raw) }); |
| 32 | +LL | | }); |
| 33 | + | |______^ |
| 34 | + |
| 35 | +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace |
| 36 | + |
| 37 | +error: aborting due to previous error |
| 38 | + |
0 commit comments