@@ -24,55 +24,55 @@ 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:100 :14
63
+ --> $DIR/offset_from_ub.rs:86 :14
64
64
|
65
65
LL | unsafe { ptr_offset_from(ptr1, ptr2) }
66
66
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
67
67
68
68
error[E0080]: evaluation of constant value failed
69
- --> $DIR/offset_from_ub.rs:107 :14
69
+ --> $DIR/offset_from_ub.rs:93 :14
70
70
|
71
71
LL | unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
72
72
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
73
73
74
74
error[E0080]: evaluation of constant value failed
75
- --> $DIR/offset_from_ub.rs:114 :14
75
+ --> $DIR/offset_from_ub.rs:100 :14
76
76
|
77
77
LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
78
78
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `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
85
85
note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
86
86
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
87
87
note: inside `OFFSET_VERY_FAR1`
88
- --> $DIR/offset_from_ub.rs:123 :14
88
+ --> $DIR/offset_from_ub.rs:109 :14
89
89
|
90
90
LL | unsafe { ptr2.offset_from(ptr1) }
91
91
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -98,7 +98,7 @@ error[E0080]: evaluation of constant value failed
98
98
note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
99
99
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
100
100
note: inside `OFFSET_VERY_FAR2`
101
- --> $DIR/offset_from_ub.rs:129 :14
101
+ --> $DIR/offset_from_ub.rs:115 :14
102
102
|
103
103
LL | unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
104
104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments