|
| 1 | +error: Undefined Behavior: write access through <TAG> at ALLOC[OFFSET] is forbidden |
| 2 | + --> tests/fail/async-shared-mutable.rs:LL:CC |
| 3 | + | |
| 4 | +LL | *x = 1; |
| 5 | + | ^^^^^^ write access through <TAG> at ALLOC[OFFSET] 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> has state Frozen which forbids this child write access |
| 9 | +help: the accessed tag <TAG> was created here, in the initial state Reserved |
| 10 | + --> tests/fail/async-shared-mutable.rs:LL:CC |
| 11 | + | |
| 12 | +LL | / core::future::poll_fn(move |_| { |
| 13 | +LL | | *x = 1; |
| 14 | +LL | | Poll::<()>::Pending |
| 15 | +LL | | }) |
| 16 | +LL | | .await |
| 17 | + | |______________^ |
| 18 | +help: the accessed tag <TAG> later transitioned to Active due to a child write access at offsets [0x8..0x9] |
| 19 | + --> tests/fail/async-shared-mutable.rs:LL:CC |
| 20 | + | |
| 21 | +LL | *x = 1; |
| 22 | + | ^^^^^^ |
| 23 | + = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference |
| 24 | +help: the accessed tag <TAG> later transitioned to Frozen due to a reborrow (acting as a foreign read access) at offsets [0x0..0x10] |
| 25 | + --> tests/fail/async-shared-mutable.rs:LL:CC |
| 26 | + | |
| 27 | +LL | let _: Pin<&_> = f.as_ref(); // Or: `f.as_mut().into_ref()`. |
| 28 | + | ^^^^^^^^^^ |
| 29 | + = help: this transition corresponds to a loss of write permissions |
| 30 | + = note: BACKTRACE (of the first span): |
| 31 | + = note: inside closure at tests/fail/async-shared-mutable.rs:LL:CC |
| 32 | + = note: inside `<std::future::PollFn<{closure@tests/fail/async-shared-mutable.rs:LL:CC}> as std::future::Future>::poll` at RUSTLIB/core/src/future/poll_fn.rs:LL:CC |
| 33 | +note: inside closure |
| 34 | + --> tests/fail/async-shared-mutable.rs:LL:CC |
| 35 | + | |
| 36 | +LL | .await |
| 37 | + | ^^^^^ |
| 38 | +note: inside `main` |
| 39 | + --> tests/fail/async-shared-mutable.rs:LL:CC |
| 40 | + | |
| 41 | +LL | assert_eq!(f.as_mut().poll(&mut cx), Poll::Pending); |
| 42 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 43 | + |
| 44 | +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace |
| 45 | + |
| 46 | +error: aborting due to 1 previous error |
| 47 | + |
0 commit comments