1
1
error: any use of this value will cause an error
2
2
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
3
3
|
4
- LL | intrinsics::offset(self, count)
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
- | |
7
- | overflowing in-bounds pointer arithmetic
8
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9
- | inside `BEFORE_START` at $DIR/offset_ub.rs:7:46
4
+ LL | unsafe { intrinsics::offset(self, count) }
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ | |
7
+ | overflowing in-bounds pointer arithmetic
8
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9
+ | inside `BEFORE_START` at $DIR/offset_ub.rs:7:46
10
10
|
11
11
::: $DIR/offset_ub.rs:7:1
12
12
|
@@ -18,12 +18,12 @@ LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1)
18
18
error: any use of this value will cause an error
19
19
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
20
20
|
21
- LL | intrinsics::offset(self, count)
22
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
- | |
24
- | inbounds test failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
25
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
26
- | inside `AFTER_END` at $DIR/offset_ub.rs:8:43
21
+ LL | unsafe { intrinsics::offset(self, count) }
22
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
+ | |
24
+ | inbounds test failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
25
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
26
+ | inside `AFTER_END` at $DIR/offset_ub.rs:8:43
27
27
|
28
28
::: $DIR/offset_ub.rs:8:1
29
29
|
@@ -33,12 +33,12 @@ LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
33
33
error: any use of this value will cause an error
34
34
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
35
35
|
36
- LL | intrinsics::offset(self, count)
37
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
- | |
39
- | inbounds test failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
40
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
41
- | inside `AFTER_ARRAY` at $DIR/offset_ub.rs:9:45
36
+ LL | unsafe { intrinsics::offset(self, count) }
37
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
+ | |
39
+ | inbounds test failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
40
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
41
+ | inside `AFTER_ARRAY` at $DIR/offset_ub.rs:9:45
42
42
|
43
43
::: $DIR/offset_ub.rs:9:1
44
44
|
@@ -48,12 +48,12 @@ LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101)
48
48
error: any use of this value will cause an error
49
49
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
50
50
|
51
- LL | intrinsics::offset(self, count)
52
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53
- | |
54
- | overflowing in-bounds pointer arithmetic
55
- | inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
56
- | inside `OVERFLOW` at $DIR/offset_ub.rs:11:43
51
+ LL | unsafe { intrinsics::offset(self, count) }
52
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53
+ | |
54
+ | overflowing in-bounds pointer arithmetic
55
+ | inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
56
+ | inside `OVERFLOW` at $DIR/offset_ub.rs:11:43
57
57
|
58
58
::: $DIR/offset_ub.rs:11:1
59
59
|
@@ -63,12 +63,12 @@ LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::
63
63
error: any use of this value will cause an error
64
64
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
65
65
|
66
- LL | intrinsics::offset(self, count)
67
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
- | |
69
- | overflowing in-bounds pointer arithmetic
70
- | inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
71
- | inside `UNDERFLOW` at $DIR/offset_ub.rs:12:44
66
+ LL | unsafe { intrinsics::offset(self, count) }
67
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
+ | |
69
+ | overflowing in-bounds pointer arithmetic
70
+ | inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
71
+ | inside `UNDERFLOW` at $DIR/offset_ub.rs:12:44
72
72
|
73
73
::: $DIR/offset_ub.rs:12:1
74
74
|
@@ -78,12 +78,12 @@ LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize:
78
78
error: any use of this value will cause an error
79
79
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
80
80
|
81
- LL | intrinsics::offset(self, count)
82
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83
- | |
84
- | overflowing in-bounds pointer arithmetic
85
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
86
- | inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:56
81
+ LL | unsafe { intrinsics::offset(self, count) }
82
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83
+ | |
84
+ | overflowing in-bounds pointer arithmetic
85
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
86
+ | inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:56
87
87
|
88
88
::: $DIR/offset_ub.rs:13:1
89
89
|
@@ -93,12 +93,12 @@ LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *cons
93
93
error: any use of this value will cause an error
94
94
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
95
95
|
96
- LL | intrinsics::offset(self, count)
97
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
- | |
99
- | overflowing in-bounds pointer arithmetic
100
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
101
- | inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14:57
96
+ LL | unsafe { intrinsics::offset(self, count) }
97
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
+ | |
99
+ | overflowing in-bounds pointer arithmetic
100
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
101
+ | inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14:57
102
102
|
103
103
::: $DIR/offset_ub.rs:14:1
104
104
|
@@ -108,12 +108,12 @@ LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).of
108
108
error: any use of this value will cause an error
109
109
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
110
110
|
111
- LL | intrinsics::offset(self, count)
112
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113
- | |
114
- | inbounds test failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
115
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
116
- | inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:16:50
111
+ LL | unsafe { intrinsics::offset(self, count) }
112
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113
+ | |
114
+ | inbounds test failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
115
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
116
+ | inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:16:50
117
117
|
118
118
::: $DIR/offset_ub.rs:16:1
119
119
|
@@ -123,12 +123,12 @@ LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1
123
123
error: any use of this value will cause an error
124
124
--> $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL
125
125
|
126
- LL | intrinsics::offset(self, count) as *mut T
127
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
- | |
129
- | unable to turn bytes into a pointer
130
- | inside `std::ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL
131
- | inside `DANGLING` at $DIR/offset_ub.rs:17:42
126
+ LL | unsafe { intrinsics::offset(self, count) as *mut T }
127
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
+ | |
129
+ | unable to turn bytes into a pointer
130
+ | inside `std::ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL
131
+ | inside `DANGLING` at $DIR/offset_ub.rs:17:42
132
132
|
133
133
::: $DIR/offset_ub.rs:17:1
134
134
|
@@ -138,12 +138,12 @@ LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_
138
138
error: any use of this value will cause an error
139
139
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
140
140
|
141
- LL | intrinsics::offset(self, count)
142
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143
- | |
144
- | inbounds test failed: 0x0 is not a valid pointer
145
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
146
- | inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:20:50
141
+ LL | unsafe { intrinsics::offset(self, count) }
142
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143
+ | |
144
+ | inbounds test failed: 0x0 is not a valid pointer
145
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
146
+ | inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:20:50
147
147
|
148
148
::: $DIR/offset_ub.rs:20:1
149
149
|
@@ -153,12 +153,12 @@ LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0
153
153
error: any use of this value will cause an error
154
154
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
155
155
|
156
- LL | intrinsics::offset(self, count)
157
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158
- | |
159
- | unable to turn bytes into a pointer
160
- | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
161
- | inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:23:47
156
+ LL | unsafe { intrinsics::offset(self, count) }
157
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158
+ | |
159
+ | unable to turn bytes into a pointer
160
+ | inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
161
+ | inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:23:47
162
162
|
163
163
::: $DIR/offset_ub.rs:23:1
164
164
|
0 commit comments