35 lines
1.9 KiB
Plaintext
35 lines
1.9 KiB
Plaintext
|
error: Undefined Behavior: deallocating while item is protected: [SharedReadWrite for <TAG> (call ID)]
|
||
|
|
|
||
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
|
||
|
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
|
||
|
|
||
|
= note: inside `std::alloc::dealloc` at rustc_src/src/alloc.rs:LL:CC
|
||
|
= note: inside `<std::alloc::Global as std::alloc::Allocator>::deallocate` at rustc_src/src/alloc.rs:LL:CC
|
||
|
= note: inside `alloc::alloc::box_free::<std::cell::Cell<i32>, std::alloc::Global>` at rustc_src/src/alloc.rs:LL:CC
|
||
|
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<std::cell::Cell<i32>>> - shim(Some(std::boxed::Box<std::cell::Cell<i32>>))` at rustc_src/src/ptr/mod.rs:LL:CC
|
||
|
= note: inside `std::mem::drop::<std::boxed::Box<std::cell::Cell<i32>>>` at rustc_src/src/mem/mod.rs:LL:CC
|
||
|
note: inside closure at $DIR/deallocate_against_barrier2.rs:LL:CC
|
||
|
--> $DIR/deallocate_against_barrier2.rs:LL:CC
|
||
|
|
|
||
|
LL | drop(unsafe { Box::from_raw(raw) });
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
|
= note: inside `<[closure@$DIR/deallocate_against_barrier2.rs:LL:CC: 16:6] as std::ops::FnOnce<(&std::cell::Cell<i32>,)>>::call_once - shim` at rustc_src/src/ops/function.rs:LL:CC
|
||
|
note: inside `inner` at $DIR/deallocate_against_barrier2.rs:LL:CC
|
||
|
--> $DIR/deallocate_against_barrier2.rs:LL:CC
|
||
|
|
|
||
|
LL | f(x)
|
||
|
| ^^^^
|
||
|
note: inside `main` at $DIR/deallocate_against_barrier2.rs:LL:CC
|
||
|
--> $DIR/deallocate_against_barrier2.rs:LL:CC
|
||
|
|
|
||
|
LL | / inner(Box::leak(Box::new(Cell::new(0))), |x| {
|
||
|
LL | | let raw = x as *const _ as *mut Cell<i32>;
|
||
|
LL | | drop(unsafe { Box::from_raw(raw) });
|
||
|
LL | | });
|
||
|
| |______^
|
||
|
|
||
|
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||
|
|
||
|
error: aborting due to previous error
|
||
|
|