|
1 | 1 | error[E0080]: evaluation of constant value failed
|
2 |
| - --> $DIR/offset_from_ub.rs:17:27 |
| 2 | + --> $DIR/offset_from_ub.rs:18:27 |
3 | 3 | |
|
4 | 4 | LL | let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) };
|
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ptr_offset_from called on pointers into different allocations |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on pointers into different allocations |
6 | 6 |
|
7 | 7 | error[E0080]: evaluation of constant value failed
|
8 | 8 | --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
9 | 9 | |
|
10 | 10 | LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
|
11 | 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
12 | 12 | | |
|
13 |
| - | ptr_offset_from called on pointers into different allocations |
| 13 | + | `ptr_offset_from` called on pointers into different allocations |
14 | 14 | | inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
15 | 15 | |
|
16 |
| - ::: $DIR/offset_from_ub.rs:23:14 |
| 16 | + ::: $DIR/offset_from_ub.rs:24:14 |
17 | 17 | |
|
18 | 18 | LL | unsafe { (42 as *const u8).offset_from(&5u8) as usize }
|
19 |
| - | ----------------------------------- inside `NOT_PTR` at $DIR/offset_from_ub.rs:23:14 |
| 19 | + | ----------------------------------- inside `NOT_PTR` at $DIR/offset_from_ub.rs:24:14 |
20 | 20 |
|
21 | 21 | error[E0080]: evaluation of constant value failed
|
22 |
| - --> $DIR/offset_from_ub.rs:30:14 |
| 22 | + --> $DIR/offset_from_ub.rs:31:14 |
23 | 23 | |
|
24 | 24 | LL | unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) }
|
25 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 1_isize cannot be divided by 2_isize without remainder
|
26 | 26 |
|
27 | 27 | error[E0080]: evaluation of constant value failed
|
28 |
| - --> $DIR/offset_from_ub.rs:36:14 |
| 28 | + --> $DIR/offset_from_ub.rs:37:14 |
29 | 29 | |
|
30 | 30 | LL | unsafe { ptr_offset_from(ptr, ptr) }
|
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
|
32 | 32 |
|
33 | 33 | error[E0080]: evaluation of constant value failed
|
34 |
| - --> $DIR/offset_from_ub.rs:43:14 |
| 34 | + --> $DIR/offset_from_ub.rs:44:14 |
35 | 35 | |
|
36 | 36 | LL | unsafe { ptr_offset_from(ptr2, ptr1) }
|
37 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: 0x8[noalloc] is a dangling pointer (it has no provenance)
|
38 | 38 |
|
39 | 39 | error[E0080]: evaluation of constant value failed
|
40 |
| - --> $DIR/offset_from_ub.rs:52:14 |
| 40 | + --> $DIR/offset_from_ub.rs:53:14 |
41 | 41 | |
|
42 | 42 | LL | unsafe { ptr_offset_from(end_ptr, start_ptr) }
|
43 | 43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc18 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
|
44 | 44 |
|
45 | 45 | error[E0080]: evaluation of constant value failed
|
46 |
| - --> $DIR/offset_from_ub.rs:61:14 |
| 46 | + --> $DIR/offset_from_ub.rs:62:14 |
47 | 47 | |
|
48 | 48 | LL | unsafe { ptr_offset_from(start_ptr, end_ptr) }
|
49 | 49 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc21 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
|
50 | 50 |
|
51 | 51 | error[E0080]: evaluation of constant value failed
|
52 |
| - --> $DIR/offset_from_ub.rs:69:14 |
| 52 | + --> $DIR/offset_from_ub.rs:70:14 |
53 | 53 | |
|
54 | 54 | LL | unsafe { ptr_offset_from(end_ptr, end_ptr) }
|
55 | 55 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: alloc24 has size 4, so pointer at offset 10 is out-of-bounds
|
56 | 56 |
|
57 | 57 | error[E0080]: evaluation of constant value failed
|
58 |
| - --> $DIR/offset_from_ub.rs:78:27 |
| 58 | + --> $DIR/offset_from_ub.rs:79:14 |
59 | 59 | |
|
60 |
| -LL | let offset = unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) }; |
61 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ptr_offset_from_unsigned called on pointers into different allocations |
| 60 | +LL | unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) } |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations |
62 | 62 |
|
63 | 63 | error[E0080]: evaluation of constant value failed
|
64 | 64 | --> $DIR/offset_from_ub.rs:86:14
|
65 | 65 | |
|
| 66 | +LL | unsafe { ptr_offset_from(ptr2, ptr1) } |
| 67 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far ahead of second |
| 68 | + |
| 69 | +error[E0080]: evaluation of constant value failed |
| 70 | + --> $DIR/offset_from_ub.rs:92:14 |
| 71 | + | |
| 72 | +LL | unsafe { ptr_offset_from(ptr1, ptr2) } |
| 73 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second |
| 74 | + |
| 75 | +error[E0080]: evaluation of constant value failed |
| 76 | + --> $DIR/offset_from_ub.rs:99:14 |
| 77 | + | |
66 | 78 | LL | unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
|
67 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ptr_offset_from_unsigned called when first pointer has smaller offset than second: 0 < 8 |
| 79 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8 |
| 80 | + |
| 81 | +error[E0080]: evaluation of constant value failed |
| 82 | + --> $DIR/offset_from_ub.rs:106:14 |
| 83 | + | |
| 84 | +LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) } |
| 85 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer is too far ahead of second |
| 86 | + |
| 87 | +error[E0080]: evaluation of constant value failed |
| 88 | + --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL |
| 89 | + | |
| 90 | +LL | unsafe { intrinsics::ptr_offset_from(self, origin) } |
| 91 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 92 | + | | |
| 93 | + | out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) |
| 94 | + | inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL |
| 95 | + | |
| 96 | + ::: $DIR/offset_from_ub.rs:115:14 |
| 97 | + | |
| 98 | +LL | unsafe { ptr2.offset_from(ptr1) } |
| 99 | + | ---------------------- inside `OFFSET_VERY_FAR1` at $DIR/offset_from_ub.rs:115:14 |
| 100 | + |
| 101 | +error[E0080]: evaluation of constant value failed |
| 102 | + --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL |
| 103 | + | |
| 104 | +LL | unsafe { intrinsics::ptr_offset_from(self, origin) } |
| 105 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 106 | + | | |
| 107 | + | out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) |
| 108 | + | inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL |
| 109 | + | |
| 110 | + ::: $DIR/offset_from_ub.rs:121:14 |
| 111 | + | |
| 112 | +LL | unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) } |
| 113 | + | ----------------------------------------- inside `OFFSET_VERY_FAR2` at $DIR/offset_from_ub.rs:121:14 |
68 | 114 |
|
69 |
| -error: aborting due to 10 previous errors |
| 115 | +error: aborting due to 15 previous errors |
70 | 116 |
|
71 | 117 | For more information about this error, try `rustc --explain E0080`.
|
0 commit comments