|
| 1 | +error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location |
| 2 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 3 | + | |
| 4 | +LL | unsafe { ptr.write(0) }; |
| 5 | + | ^^^^^^^^^^^^ |
| 6 | + | | |
| 7 | + | attempting a write access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location |
| 8 | + | this error occurs as part of an access at ALLOC[0x0..0x4] |
| 9 | + | |
| 10 | + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental |
| 11 | + = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information |
| 12 | +help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4] |
| 13 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 14 | + | |
| 15 | +LL | / mir! { |
| 16 | +LL | | { |
| 17 | +LL | | let _x = 0; |
| 18 | +LL | | let ptr = &raw mut _x; |
| 19 | +... | |
| 20 | +LL | | } |
| 21 | +LL | | } |
| 22 | + | |_____^ |
| 23 | +help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique in-place function argument/return passing protection |
| 24 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 25 | + | |
| 26 | +LL | unsafe { ptr.write(0) }; |
| 27 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 28 | + = note: BACKTRACE (of the first span): |
| 29 | + = note: inside `myfun` at $DIR/return_pointer_aliasing2.rs:LL:CC |
| 30 | +note: inside `main` |
| 31 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 32 | + | |
| 33 | +LL | Call(_x = myfun(ptr), after_call) |
| 34 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 35 | + = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 36 | + |
| 37 | +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace |
| 38 | + |
| 39 | +error: aborting due to previous error |
| 40 | + |
0 commit comments