]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/newtype_pair_retagging.stderr
Rollup merge of #105468 - sunfishcode:sunfishcode/main-void-wasi, r=estebank
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / newtype_pair_retagging.stderr
1 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected because it is an argument of call ID
2   --> RUSTLIB/alloc/src/boxed.rs:LL:CC
3    |
4 LL |         Box(unsafe { Unique::new_unchecked(raw) }, alloc)
5    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected because it is an argument of 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 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
10   --> $DIR/newtype_pair_retagging.rs:LL:CC
11    |
12 LL |     let ptr = Box::into_raw(Box::new(0i32));
13    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 help: <TAG> is this argument
15   --> $DIR/newtype_pair_retagging.rs:LL:CC
16    |
17 LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) {
18    |                          ^^
19    = note: BACKTRACE:
20    = note: inside `std::boxed::Box::<i32>::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC
21    = note: inside `std::boxed::Box::<i32>::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC
22 note: inside closure
23   --> $DIR/newtype_pair_retagging.rs:LL:CC
24    |
25 LL |             || drop(Box::from_raw(ptr)),
26    |                     ^^^^^^^^^^^^^^^^^^
27 note: inside `dealloc_while_running::<[closure@$DIR/newtype_pair_retagging.rs:LL:CC]>`
28   --> $DIR/newtype_pair_retagging.rs:LL:CC
29    |
30 LL |     dealloc();
31    |     ^^^^^^^^^
32 note: inside `main`
33   --> $DIR/newtype_pair_retagging.rs:LL:CC
34    |
35 LL | /         dealloc_while_running(
36 LL | |             Newtype(&mut *ptr, 0),
37 LL | |             || drop(Box::from_raw(ptr)),
38 LL | |         )
39    | |_________^
40
41 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
42
43 error: aborting due to previous error
44