@@ -24,55 +24,55 @@ LL | unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) }
2424 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 1_isize cannot be divided by 2_isize without remainder
2525
2626error[E0080]: evaluation of constant value failed
27- --> $DIR/offset_from_ub.rs:44 :14
27+ --> $DIR/offset_from_ub.rs:38 :14
2828 |
2929LL | unsafe { ptr_offset_from(ptr2, ptr1) }
3030 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on different pointers without provenance (i.e., without an associated allocation)
3131
3232error[E0080]: evaluation of constant value failed
33- --> $DIR/offset_from_ub.rs:53 :14
33+ --> $DIR/offset_from_ub.rs:47 :14
3434 |
3535LL | unsafe { ptr_offset_from(end_ptr, start_ptr) }
3636 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: ALLOC0 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
3737
3838error[E0080]: evaluation of constant value failed
39- --> $DIR/offset_from_ub.rs:62 :14
39+ --> $DIR/offset_from_ub.rs:56 :14
4040 |
4141LL | unsafe { ptr_offset_from(start_ptr, end_ptr) }
4242 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: ALLOC1 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
4343
4444error[E0080]: evaluation of constant value failed
45- --> $DIR/offset_from_ub.rs:79 :14
45+ --> $DIR/offset_from_ub.rs:65 :14
4646 |
4747LL | unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) }
4848 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
4949
5050error[E0080]: evaluation of constant value failed
51- --> $DIR/offset_from_ub.rs:86 :14
51+ --> $DIR/offset_from_ub.rs:72 :14
5252 |
5353LL | unsafe { ptr_offset_from(ptr2, ptr1) }
5454 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far ahead of second
5555
5656error[E0080]: evaluation of constant value failed
57- --> $DIR/offset_from_ub.rs:92 :14
57+ --> $DIR/offset_from_ub.rs:78 :14
5858 |
5959LL | unsafe { ptr_offset_from(ptr1, ptr2) }
6060 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
6161
6262error[E0080]: evaluation of constant value failed
63- --> $DIR/offset_from_ub.rs:100 :14
63+ --> $DIR/offset_from_ub.rs:86 :14
6464 |
6565LL | unsafe { ptr_offset_from(ptr1, ptr2) }
6666 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
6767
6868error[E0080]: evaluation of constant value failed
69- --> $DIR/offset_from_ub.rs:107 :14
69+ --> $DIR/offset_from_ub.rs:93 :14
7070 |
7171LL | unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
7272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
7373
7474error[E0080]: evaluation of constant value failed
75- --> $DIR/offset_from_ub.rs:114 :14
75+ --> $DIR/offset_from_ub.rs:100 :14
7676 |
7777LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
7878 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer is too far ahead of second
@@ -85,7 +85,7 @@ error[E0080]: evaluation of constant value failed
8585note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
8686 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
8787note: inside `OFFSET_VERY_FAR1`
88- --> $DIR/offset_from_ub.rs:123 :14
88+ --> $DIR/offset_from_ub.rs:109 :14
8989 |
9090LL | unsafe { ptr2.offset_from(ptr1) }
9191 | ^^^^^^^^^^^^^^^^^^^^^^
@@ -98,7 +98,7 @@ error[E0080]: evaluation of constant value failed
9898note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
9999 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
100100note: inside `OFFSET_VERY_FAR2`
101- --> $DIR/offset_from_ub.rs:129 :14
101+ --> $DIR/offset_from_ub.rs:115 :14
102102 |
103103LL | unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
104104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments