@@ -60,13 +60,19 @@ LL | unsafe { ptr_offset_from(ptr1, ptr2) }
60
60
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
61
61
62
62
error[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
64
70
|
65
71
LL | unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
66
72
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
67
73
68
74
error[E0080]: evaluation of constant value failed
69
- --> $DIR/offset_from_ub.rs:106 :14
75
+ --> $DIR/offset_from_ub.rs:114 :14
70
76
|
71
77
LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
72
78
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `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
79
85
note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
80
86
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
81
87
note: inside `OFFSET_VERY_FAR1`
82
- --> $DIR/offset_from_ub.rs:115 :14
88
+ --> $DIR/offset_from_ub.rs:123 :14
83
89
|
84
90
LL | unsafe { ptr2.offset_from(ptr1) }
85
91
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -92,11 +98,11 @@ error[E0080]: evaluation of constant value failed
92
98
note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
93
99
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
94
100
note: inside `OFFSET_VERY_FAR2`
95
- --> $DIR/offset_from_ub.rs:121 :14
101
+ --> $DIR/offset_from_ub.rs:129 :14
96
102
|
97
103
LL | unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
98
104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99
105
100
- error: aborting due to 13 previous errors
106
+ error: aborting due to 14 previous errors
101
107
102
108
For more information about this error, try `rustc --explain E0080`.
0 commit comments