|
| 1 | +error: Undefined Behavior: write access through <TAG> (root of the allocation) is forbidden |
| 2 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 3 | + | |
| 4 | +LL | unsafe { ptr.write(0) }; |
| 5 | + | ^^^^^^^^^^^^ write access through <TAG> (root of the allocation) is forbidden |
| 6 | + | |
| 7 | + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental |
| 8 | + = help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child) |
| 9 | + = help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled |
| 10 | + = help: protected tags must never be Disabled |
| 11 | +help: the accessed tag <TAG> was created here |
| 12 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 13 | + | |
| 14 | +LL | / mir! { |
| 15 | +LL | | { |
| 16 | +LL | | let x = 0; |
| 17 | +LL | | let ptr = &raw mut x; |
| 18 | +... | |
| 19 | +LL | | } |
| 20 | +LL | | } |
| 21 | + | |_____^ |
| 22 | +help: the protected tag <TAG> was created here, in the initial state Active |
| 23 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 24 | + | |
| 25 | +LL | unsafe { ptr.write(0) }; |
| 26 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 27 | + = note: BACKTRACE (of the first span): |
| 28 | + = note: inside `myfun` at $DIR/return_pointer_aliasing2.rs:LL:CC |
| 29 | +note: inside `main` |
| 30 | + --> $DIR/return_pointer_aliasing2.rs:LL:CC |
| 31 | + | |
| 32 | +LL | Call(x, after_call, myfun(ptr)) |
| 33 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 34 | + = 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) |
| 35 | + |
| 36 | +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace |
| 37 | + |
| 38 | +error: aborting due to previous error |
| 39 | + |
0 commit comments