@@ -7,10 +7,10 @@ LL | unsafe { intrinsics::offset(self, count) }
7
7
| overflowing in-bounds pointer arithmetic
8
8
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
9
9
|
10
- ::: $DIR/offset_ub.rs:8 :46
10
+ ::: $DIR/offset_ub.rs:7 :46
11
11
|
12
12
LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) };
13
- | ------------------------------ inside `BEFORE_START` at $DIR/offset_ub.rs:8 :46
13
+ | ------------------------------ inside `BEFORE_START` at $DIR/offset_ub.rs:7 :46
14
14
15
15
error[E0080]: evaluation of constant value failed
16
16
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -21,10 +21,10 @@ LL | unsafe { intrinsics::offset(self, count) }
21
21
| pointer arithmetic failed: allocN has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds
22
22
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
23
23
|
24
- ::: $DIR/offset_ub.rs:9 :43
24
+ ::: $DIR/offset_ub.rs:8 :43
25
25
|
26
26
LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
27
- | ----------------------------- inside `AFTER_END` at $DIR/offset_ub.rs:9 :43
27
+ | ----------------------------- inside `AFTER_END` at $DIR/offset_ub.rs:8 :43
28
28
29
29
error[E0080]: evaluation of constant value failed
30
30
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -35,10 +35,10 @@ LL | unsafe { intrinsics::offset(self, count) }
35
35
| pointer arithmetic failed: allocN has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds
36
36
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
37
37
|
38
- ::: $DIR/offset_ub.rs:10 :45
38
+ ::: $DIR/offset_ub.rs:9 :45
39
39
|
40
40
LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) };
41
- | ------------------------------- inside `AFTER_ARRAY` at $DIR/offset_ub.rs:10 :45
41
+ | ------------------------------- inside `AFTER_ARRAY` at $DIR/offset_ub.rs:9 :45
42
42
43
43
error[E0080]: evaluation of constant value failed
44
44
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -49,10 +49,10 @@ LL | unsafe { intrinsics::offset(self, count) }
49
49
| overflowing in-bounds pointer arithmetic
50
50
| inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
51
51
|
52
- ::: $DIR/offset_ub.rs:12 :43
52
+ ::: $DIR/offset_ub.rs:11 :43
53
53
|
54
54
LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) };
55
- | ------------------------------------- inside `OVERFLOW` at $DIR/offset_ub.rs:12 :43
55
+ | ------------------------------------- inside `OVERFLOW` at $DIR/offset_ub.rs:11 :43
56
56
57
57
error[E0080]: evaluation of constant value failed
58
58
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -63,10 +63,10 @@ LL | unsafe { intrinsics::offset(self, count) }
63
63
| overflowing in-bounds pointer arithmetic
64
64
| inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
65
65
|
66
- ::: $DIR/offset_ub.rs:13 :44
66
+ ::: $DIR/offset_ub.rs:12 :44
67
67
|
68
68
LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
69
- | ------------------------------------- inside `UNDERFLOW` at $DIR/offset_ub.rs:13 :44
69
+ | ------------------------------------- inside `UNDERFLOW` at $DIR/offset_ub.rs:12 :44
70
70
71
71
error[E0080]: evaluation of constant value failed
72
72
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -77,10 +77,10 @@ LL | unsafe { intrinsics::offset(self, count) }
77
77
| overflowing in-bounds pointer arithmetic
78
78
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
79
79
|
80
- ::: $DIR/offset_ub.rs:14 :56
80
+ ::: $DIR/offset_ub.rs:13 :56
81
81
|
82
82
LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) };
83
- | ----------------------------------- inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14 :56
83
+ | ----------------------------------- inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13 :56
84
84
85
85
error[E0080]: evaluation of constant value failed
86
86
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -91,10 +91,10 @@ LL | unsafe { intrinsics::offset(self, count) }
91
91
| overflowing in-bounds pointer arithmetic
92
92
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
93
93
|
94
- ::: $DIR/offset_ub.rs:15 :57
94
+ ::: $DIR/offset_ub.rs:14 :57
95
95
|
96
96
LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) };
97
- | --------------------------- inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:15 :57
97
+ | --------------------------- inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14 :57
98
98
99
99
error[E0080]: evaluation of constant value failed
100
100
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -105,10 +105,10 @@ LL | unsafe { intrinsics::offset(self, count) }
105
105
| pointer arithmetic failed: allocN has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds
106
106
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
107
107
|
108
- ::: $DIR/offset_ub.rs:16 :49
108
+ ::: $DIR/offset_ub.rs:15 :49
109
109
|
110
110
LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_offset(-2).offset(-2) };
111
- | ------------------------------------------------ inside `NEGATIVE_OFFSET` at $DIR/offset_ub.rs:16 :49
111
+ | ------------------------------------------------ inside `NEGATIVE_OFFSET` at $DIR/offset_ub.rs:15 :49
112
112
113
113
error[E0080]: evaluation of constant value failed
114
114
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -119,10 +119,10 @@ LL | unsafe { intrinsics::offset(self, count) }
119
119
| pointer arithmetic failed: allocN has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds
120
120
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
121
121
|
122
- ::: $DIR/offset_ub.rs:18 :50
122
+ ::: $DIR/offset_ub.rs:17 :50
123
123
|
124
124
LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) };
125
- | --------------------------- inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:18 :50
125
+ | --------------------------- inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:17 :50
126
126
127
127
error[E0080]: evaluation of constant value failed
128
128
--> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
@@ -133,10 +133,10 @@ LL | unsafe { intrinsics::offset(self, count) as *mut T }
133
133
| 0x1 is not a valid pointer
134
134
| inside `ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
135
135
|
136
- ::: $DIR/offset_ub.rs:19 :42
136
+ ::: $DIR/offset_ub.rs:18 :42
137
137
|
138
138
LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) };
139
- | ------------------------------------------------- inside `DANGLING` at $DIR/offset_ub.rs:19 :42
139
+ | ------------------------------------------------- inside `DANGLING` at $DIR/offset_ub.rs:18 :42
140
140
141
141
error[E0080]: evaluation of constant value failed
142
142
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -147,10 +147,10 @@ LL | unsafe { intrinsics::offset(self, count) }
147
147
| pointer arithmetic failed: 0x0 is not a valid pointer
148
148
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
149
149
|
150
- ::: $DIR/offset_ub.rs:22 :50
150
+ ::: $DIR/offset_ub.rs:21 :50
151
151
|
152
152
LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0) };
153
- | --------------------------- inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:22 :50
153
+ | --------------------------- inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:21 :50
154
154
155
155
error[E0080]: evaluation of constant value failed
156
156
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -161,10 +161,10 @@ LL | unsafe { intrinsics::offset(self, count) }
161
161
| 0x7f..f is not a valid pointer
162
162
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
163
163
|
164
- ::: $DIR/offset_ub.rs:25 :47
164
+ ::: $DIR/offset_ub.rs:24 :47
165
165
|
166
166
LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) };
167
- | -------------------------------------------- inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:25 :47
167
+ | -------------------------------------------- inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:24 :47
168
168
169
169
error: aborting due to 12 previous errors
170
170
0 commit comments