summaryrefslogtreecommitdiff
path: root/src/tools/miri/tests/fail/tree-borrows/strongly-protected.stderr
blob: 071b216ff982befde074245a6f69d5183205d9e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
error: Undefined Behavior: deallocation through <TAG> is forbidden
  --> RUSTLIB/alloc/src/alloc.rs:LL:CC
   |
LL |     unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> is forbidden
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
   = help: the allocation of the accessed tag <TAG> also contains the strongly protected tag <TAG>
   = help: the strongly protected tag <TAG> disallows deallocations
help: the accessed tag <TAG> was created here
  --> $DIR/strongly-protected.rs:LL:CC
   |
LL |         drop(unsafe { Box::from_raw(raw) });
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: the strongly protected tag <TAG> was created here, in the initial state Reserved
  --> $DIR/strongly-protected.rs:LL:CC
   |
LL | fn inner(x: &mut i32, f: fn(&mut i32)) {
   |          ^
help: the strongly protected tag <TAG> then transitioned from Reserved to Active due to a child write access at offsets [0x0..0x4]
  --> $DIR/strongly-protected.rs:LL:CC
   |
LL |         drop(unsafe { Box::from_raw(raw) });
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: this corresponds to an activation
   = note: BACKTRACE (of the first span):
   = note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
   = note: inside `<std::alloc::Global as std::alloc::Allocator>::deallocate` at RUSTLIB/alloc/src/alloc.rs:LL:CC
   = note: inside `alloc::alloc::box_free::<i32, std::alloc::Global>` at RUSTLIB/alloc/src/alloc.rs:LL:CC
   = note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
   = note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
note: inside closure
  --> $DIR/strongly-protected.rs:LL:CC
   |
LL |         drop(unsafe { Box::from_raw(raw) });
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: inside `<[closure@$DIR/strongly-protected.rs:LL:CC] as std::ops::FnOnce<(&mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC
note: inside `inner`
  --> $DIR/strongly-protected.rs:LL:CC
   |
LL |     f(x)
   |     ^^^^
note: inside `main`
  --> $DIR/strongly-protected.rs:LL:CC
   |
LL | /     inner(Box::leak(Box::new(0)), |x| {
LL | |         let raw = x as *mut _;
LL | |         drop(unsafe { Box::from_raw(raw) });
LL | |     });
   | |______^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to previous error