|
| 1 | +error: Undefined Behavior: deallocation through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden |
| 2 | + --> RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 3 | + | |
| 4 | +LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) } |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> (root of the allocation) at ALLOC[0x0] 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 allocation of the accessed tag <TAG> (root of the allocation) also contains the strongly protected tag <TAG> |
| 9 | + = help: the strongly protected tag <TAG> disallows deallocations |
| 10 | +help: the accessed tag <TAG> was created here |
| 11 | + --> $DIR/zero-sized-protected.rs:LL:CC |
| 12 | + | |
| 13 | +LL | let ptr = unsafe { alloc(l) }; |
| 14 | + | ^^^^^^^^ |
| 15 | +help: the strongly protected tag <TAG> was created here, in the initial state Reserved |
| 16 | + --> $DIR/zero-sized-protected.rs:LL:CC |
| 17 | + | |
| 18 | +LL | fn test(_x: &mut (), ptr: *mut u8, l: Layout) { |
| 19 | + | ^^ |
| 20 | + = note: BACKTRACE (of the first span): |
| 21 | + = note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC |
| 22 | +note: inside `test` |
| 23 | + --> $DIR/zero-sized-protected.rs:LL:CC |
| 24 | + | |
| 25 | +LL | unsafe { dealloc(ptr, l) }; |
| 26 | + | ^^^^^^^^^^^^^^^ |
| 27 | +note: inside `main` |
| 28 | + --> $DIR/zero-sized-protected.rs:LL:CC |
| 29 | + | |
| 30 | +LL | unsafe { test(&mut *ptr.cast::<()>(), ptr, l) }; |
| 31 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 32 | + |
| 33 | +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace |
| 34 | + |
| 35 | +error: aborting due to 1 previous error |
| 36 | + |
0 commit comments