]> git.lizzy.rs Git - rust.git/blob - tests/fail/stacked_borrows/deallocate_against_barrier1.stderr
Auto merge of #2515 - RalfJung:build, r=RalfJung
[rust.git] / tests / fail / stacked_borrows / deallocate_against_barrier1.stderr
1 error: Undefined Behavior: deallocating while item [Unique for <TAG>] is protected by 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 [Unique for <TAG>] is protected by 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    = note: backtrace:
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::<i32, std::alloc::Global>` at RUSTLIB/alloc/src/alloc.rs:LL:CC
13    = note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
14    = note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
15 note: inside closure at $DIR/deallocate_against_barrier1.rs:LL:CC
16   --> $DIR/deallocate_against_barrier1.rs:LL:CC
17    |
18 LL |         drop(unsafe { Box::from_raw(raw) });
19    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20    = note: inside `<[closure@$DIR/deallocate_against_barrier1.rs:LL:CC] as std::ops::FnOnce<(&mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC
21 note: inside `inner` at $DIR/deallocate_against_barrier1.rs:LL:CC
22   --> $DIR/deallocate_against_barrier1.rs:LL:CC
23    |
24 LL |     f(x)
25    |     ^^^^
26 note: inside `main` at $DIR/deallocate_against_barrier1.rs:LL:CC
27   --> $DIR/deallocate_against_barrier1.rs:LL:CC
28    |
29 LL | /     inner(Box::leak(Box::new(0)), |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