|
| 1 | +error: Undefined Behavior: write access through <TAG> is forbidden |
| 2 | + --> RUSTLIB/core/src/mem/mod.rs:LL:CC |
| 3 | + | |
| 4 | +LL | ptr::write(dest, src); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^ write access through <TAG> 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> is foreign to the protected tag <TAG> (i.e., it is not a child) |
| 9 | + = help: the access would cause the protected tag <TAG> to transition from Frozen to Disabled |
| 10 | + = help: this is a loss of read permissions, which is not allowed for protected tags |
| 11 | +help: the accessed tag <TAG> was created here |
| 12 | + --> $DIR/aliasing_mut4.rs:LL:CC |
| 13 | + | |
| 14 | +LL | y.set(1); |
| 15 | + | ^^^^^^^^ |
| 16 | +help: the protected tag <TAG> was created here, in the initial state Frozen |
| 17 | + --> $DIR/aliasing_mut4.rs:LL:CC |
| 18 | + | |
| 19 | +LL | pub fn safe(x: &i32, y: &mut Cell<i32>) { |
| 20 | + | ^ |
| 21 | + = note: BACKTRACE (of the first span): |
| 22 | + = note: inside `std::mem::replace::<i32>` at RUSTLIB/core/src/mem/mod.rs:LL:CC |
| 23 | + = note: inside `std::cell::Cell::<i32>::replace` at RUSTLIB/core/src/cell.rs:LL:CC |
| 24 | + = note: inside `std::cell::Cell::<i32>::set` at RUSTLIB/core/src/cell.rs:LL:CC |
| 25 | +note: inside `safe` |
| 26 | + --> $DIR/aliasing_mut4.rs:LL:CC |
| 27 | + | |
| 28 | +LL | y.set(1); |
| 29 | + | ^^^^^^^^ |
| 30 | +note: inside `main` |
| 31 | + --> $DIR/aliasing_mut4.rs:LL:CC |
| 32 | + | |
| 33 | +LL | safe_raw(xshr, xraw as *mut _); |
| 34 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 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