You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/test/ui/const-ptr/forbidden_slices.32bit.stderr
+6-4
Original file line number
Diff line number
Diff line change
@@ -55,9 +55,10 @@ error[E0080]: it is undefined behavior to use this value
55
55
--> $DIR/forbidden_slices.rs:27:1
56
56
|
57
57
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
58
-
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
58
+
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
59
59
|
60
-
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
60
+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
61
+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
61
62
= note: the raw bytes of the constant (size: 8, align: 4) {
62
63
╾─ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
63
64
}
@@ -170,9 +171,10 @@ error[E0080]: it is undefined behavior to use this value
170
171
--> $DIR/forbidden_slices.rs:57:1
171
172
|
172
173
LL | pub static R5: &[u8] = unsafe {
173
-
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
174
+
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
174
175
|
175
-
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
176
+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
177
+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
176
178
= note: the raw bytes of the constant (size: 8, align: 4) {
Copy file name to clipboardExpand all lines: src/test/ui/const-ptr/forbidden_slices.64bit.stderr
+6-4
Original file line number
Diff line number
Diff line change
@@ -55,9 +55,10 @@ error[E0080]: it is undefined behavior to use this value
55
55
--> $DIR/forbidden_slices.rs:27:1
56
56
|
57
57
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
58
-
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
58
+
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
59
59
|
60
-
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
60
+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
61
+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
61
62
= note: the raw bytes of the constant (size: 16, align: 8) {
@@ -170,9 +171,10 @@ error[E0080]: it is undefined behavior to use this value
170
171
--> $DIR/forbidden_slices.rs:57:1
171
172
|
172
173
LL | pub static R5: &[u8] = unsafe {
173
-
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
174
+
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
174
175
|
175
-
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
176
+
= help: this code performed an operation that depends on the underlying bytes representing a pointer
177
+
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
176
178
= note: the raw bytes of the constant (size: 16, align: 8) {
0 commit comments