@@ -24,49 +24,49 @@ LL | unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) }
24
24
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 1_isize cannot be divided by 2_isize without remainder
25
25
26
26
error[E0080]: evaluation of constant value failed
27
- --> $DIR/offset_from_ub.rs:44 :14
27
+ --> $DIR/offset_from_ub.rs:38 :14
28
28
|
29
29
LL | unsafe { ptr_offset_from(ptr2, ptr1) }
30
30
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on different pointers without provenance (i.e., without an associated allocation)
31
31
32
32
error[E0080]: evaluation of constant value failed
33
- --> $DIR/offset_from_ub.rs:53 :14
33
+ --> $DIR/offset_from_ub.rs:47 :14
34
34
|
35
35
LL | unsafe { ptr_offset_from(end_ptr, start_ptr) }
36
36
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: ALLOC0 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
37
37
38
38
error[E0080]: evaluation of constant value failed
39
- --> $DIR/offset_from_ub.rs:62 :14
39
+ --> $DIR/offset_from_ub.rs:56 :14
40
40
|
41
41
LL | unsafe { ptr_offset_from(start_ptr, end_ptr) }
42
42
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: ALLOC1 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
43
43
44
44
error[E0080]: evaluation of constant value failed
45
- --> $DIR/offset_from_ub.rs:79 :14
45
+ --> $DIR/offset_from_ub.rs:65 :14
46
46
|
47
47
LL | unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) }
48
48
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
49
49
50
50
error[E0080]: evaluation of constant value failed
51
- --> $DIR/offset_from_ub.rs:86 :14
51
+ --> $DIR/offset_from_ub.rs:72 :14
52
52
|
53
53
LL | unsafe { ptr_offset_from(ptr2, ptr1) }
54
54
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far ahead of second
55
55
56
56
error[E0080]: evaluation of constant value failed
57
- --> $DIR/offset_from_ub.rs:92 :14
57
+ --> $DIR/offset_from_ub.rs:78 :14
58
58
|
59
59
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:85 :14
64
64
|
65
65
LL | unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
66
66
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
67
67
68
68
error[E0080]: evaluation of constant value failed
69
- --> $DIR/offset_from_ub.rs:106 :14
69
+ --> $DIR/offset_from_ub.rs:92 :14
70
70
|
71
71
LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
72
72
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer is too far ahead of second
@@ -79,7 +79,7 @@ error[E0080]: evaluation of constant value failed
79
79
note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
80
80
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
81
81
note: inside `OFFSET_VERY_FAR1`
82
- --> $DIR/offset_from_ub.rs:115 :14
82
+ --> $DIR/offset_from_ub.rs:101 :14
83
83
|
84
84
LL | unsafe { ptr2.offset_from(ptr1) }
85
85
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -92,7 +92,7 @@ error[E0080]: evaluation of constant value failed
92
92
note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
93
93
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
94
94
note: inside `OFFSET_VERY_FAR2`
95
- --> $DIR/offset_from_ub.rs:121 :14
95
+ --> $DIR/offset_from_ub.rs:107 :14
96
96
|
97
97
LL | unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
98
98
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments