blob: c96ef5a80005278dd855fcb3be463e94a3562dbc [file]
error: Undefined Behavior: deallocating while item [Unique for <TAG>] is strongly protected (i.e. it is in use as a function argument)
--> RUSTLIB/alloc/src/boxed.rs:LL:CC
|
LL | self.1.deallocate(From::from(ptr.cast()), layout);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| This deallocation would invalidate a reference in function argument position, which is forbidden.
| Reference <TAG> was used as a function argument and must remain dereferenceable for the entire function.
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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
help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
--> tests/fail/both_borrows/closure-captured-ref.rs:LL:CC
|
LL | drop(unsafe { Box::from_raw(p) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: <TAG> is this argument
--> tests/fail/both_borrows/closure-captured-ref.rs:LL:CC
|
LL | invoke(move || {
| ____________^
LL | | drop(unsafe { Box::from_raw(p) });
LL | | });
| |_____^
= note: stack backtrace:
0: <std::boxed::Box<i32> as std::ops::Drop>::drop
at RUSTLIB/alloc/src/boxed.rs:LL:CC
1: std::ptr::drop_glue::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))
at RUSTLIB/core/src/ptr/mod.rs:LL:CC
2: std::mem::drop::<std::boxed::Box<i32>>
at RUSTLIB/core/src/mem/mod.rs:LL:CC
3: main::{closure#0}
at tests/fail/both_borrows/closure-captured-ref.rs:LL:CC
4: main::invoke::<{closure@tests/fail/both_borrows/closure-captured-ref.rs:LL:CC}>
at tests/fail/both_borrows/closure-captured-ref.rs:LL:CC
5: main
at tests/fail/both_borrows/closure-captured-ref.rs:LL:CC
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
error: aborting due to 1 previous error