]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector2.stderr
Auto merge of #105416 - nnethercote:more-linting-tweaks, r=cjgillot
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / deallocate_against_protector2.stderr
1 error: Undefined Behavior: deallocating while item [SharedReadWrite for <TAG>] is strongly 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 [SharedReadWrite for <TAG>] is strongly 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::<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
16   --> $DIR/deallocate_against_protector2.rs:LL:CC
17    |
18 LL |         drop(unsafe { Box::from_raw(raw) });
19    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20    = note: inside `<[closure@$DIR/deallocate_against_protector2.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`
22   --> $DIR/deallocate_against_protector2.rs:LL:CC
23    |
24 LL |     f(x)
25    |     ^^^^
26 note: inside `main`
27   --> $DIR/deallocate_against_protector2.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