@@ -60,13 +60,19 @@ LL | 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:99:14
63+ --> $DIR/offset_from_ub.rs:100:14
64+ |
65+ LL | unsafe { ptr_offset_from(ptr1, ptr2) }
66+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
67+
68+ error[E0080]: evaluation of constant value failed
69+ --> $DIR/offset_from_ub.rs:107:14
6470 |
6571LL | unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
6672 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
6773
6874error[E0080]: evaluation of constant value failed
69- --> $DIR/offset_from_ub.rs:106 :14
75+ --> $DIR/offset_from_ub.rs:114 :14
7076 |
7177LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
7278 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer is too far ahead of second
@@ -79,7 +85,7 @@ error[E0080]: evaluation of constant value failed
7985note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
8086 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
8187note: inside `OFFSET_VERY_FAR1`
82- --> $DIR/offset_from_ub.rs:115 :14
88+ --> $DIR/offset_from_ub.rs:123 :14
8389 |
8490LL | unsafe { ptr2.offset_from(ptr1) }
8591 | ^^^^^^^^^^^^^^^^^^^^^^
@@ -92,11 +98,11 @@ error[E0080]: evaluation of constant value failed
9298note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
9399 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
94100note: inside `OFFSET_VERY_FAR2`
95- --> $DIR/offset_from_ub.rs:121 :14
101+ --> $DIR/offset_from_ub.rs:129 :14
96102 |
97103LL | unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
98104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99105
100- error: aborting due to 13 previous errors
106+ error: aborting due to 14 previous errors
101107
102108For more information about this error, try `rustc --explain E0080`.
0 commit comments