2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
2022-12-09 09:56:23 -06:00
= note: dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
2022-11-30 06:10:41 -06:00
|
note: inside `std::slice::from_raw_parts::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `S0`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:19:34
2022-05-27 10:08:22 -05:00
|
LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
2022-12-09 09:56:23 -06:00
= note: dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
2022-11-30 06:10:41 -06:00
|
note: inside `std::slice::from_raw_parts::<'_, ()>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `S1`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:20:33
2022-05-27 10:08:22 -05:00
|
LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
2022-11-20 02:54:45 -06:00
= note: dereferencing pointer failed: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
2022-11-30 06:10:41 -06:00
|
note: inside `std::slice::from_raw_parts::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `S2`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:23:34
2022-05-27 10:08:22 -05:00
|
LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:26:1
2022-05-27 10:08:22 -05:00
|
LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
2022-05-27 10:08:22 -05:00
|
= 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.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-05-27 10:08:22 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:28:1
2022-05-27 10:08:22 -05:00
|
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
2022-05-27 10:08:22 -05:00
|
2023-08-02 09:14:36 -05:00
= 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.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-05-27 10:08:22 -05:00
}
2023-05-17 05:30:14 -05:00
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2022-05-27 10:08:22 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:30:1
2022-05-27 10:08:22 -05:00
|
LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
2022-05-27 10:08:22 -05:00
|
= 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.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-05-27 10:08:22 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:33:1
2022-05-27 10:08:22 -05:00
|
2022-02-13 09:27:59 -06:00
LL | pub static S7: &[u16] = unsafe {
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized memory, but expected an integer
2022-05-27 10:08:22 -05:00
|
= 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.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-05-27 10:08:22 -05:00
}
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
2022-11-20 02:54:45 -06:00
= note: dereferencing pointer failed: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
2022-05-27 10:08:22 -05:00
|
2022-11-30 06:10:41 -06:00
note: inside `std::slice::from_raw_parts::<'_, u64>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `S8`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:44:5
2022-05-27 10:08:22 -05:00
|
LL | from_raw_parts(ptr, 1)
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2023-05-17 05:30:14 -05:00
= note: out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
2022-05-27 10:08:22 -05:00
|
2022-11-30 06:10:41 -06:00
note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `from_ptr_range::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R0`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:47:34
2022-05-27 10:08:22 -05:00
|
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2022-12-09 09:56:23 -06:00
= note: the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
2022-05-27 10:08:22 -05:00
|
2022-11-30 06:10:41 -06:00
note: inside `ptr::const_ptr::<impl *const ()>::sub_ptr`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `from_ptr_range::<'_, ()>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R1`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:48:33
2022-05-27 10:08:22 -05:00
|
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2022-11-20 02:54:45 -06:00
= note: out-of-bounds pointer arithmetic: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
2022-11-30 06:10:41 -06:00
|
note: inside `ptr::const_ptr::<impl *const u32>::add`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `R2`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:51:25
2022-05-27 10:08:22 -05:00
|
LL | from_ptr_range(ptr..ptr.add(2))
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:53:1
2022-05-27 10:08:22 -05:00
|
2022-02-13 09:27:59 -06:00
LL | pub static R4: &[u8] = unsafe {
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
2022-05-27 10:08:22 -05:00
|
= 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.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-05-27 10:08:22 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:58:1
2022-05-27 10:08:22 -05:00
|
2022-02-13 09:27:59 -06:00
LL | pub static R5: &[u8] = unsafe {
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
2022-05-27 10:08:22 -05:00
|
2023-08-02 09:14:36 -05:00
= 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.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-05-27 10:08:22 -05:00
}
2023-05-17 05:30:14 -05:00
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2022-05-27 10:08:22 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:63:1
2022-05-27 10:08:22 -05:00
|
2022-02-13 09:27:59 -06:00
LL | pub static R6: &[bool] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
2022-05-27 10:08:22 -05:00
|
= 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.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-05-27 10:08:22 -05:00
}
2022-11-20 02:54:45 -06:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
2022-05-27 10:08:22 -05:00
|
2022-11-20 02:54:45 -06:00
= note: accessing memory with alignment 1, but alignment 2 is required
2022-05-27 10:08:22 -05:00
|
2022-11-20 02:54:45 -06:00
note: inside `std::slice::from_raw_parts::<'_, u16>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `from_ptr_range::<'_, u16>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R7`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:70:5
2022-11-20 02:54:45 -06:00
|
LL | from_ptr_range(ptr..ptr.add(4))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2022-11-20 02:54:45 -06:00
= note: out-of-bounds pointer arithmetic: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
2022-11-30 06:10:41 -06:00
|
note: inside `ptr::const_ptr::<impl *const u64>::add`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `R8`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:74:25
2022-05-27 10:08:22 -05:00
|
LL | from_ptr_range(ptr..ptr.add(1))
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2022-12-09 09:56:23 -06:00
= note: `ptr_offset_from_unsigned` called on pointers into different allocations
2022-05-27 10:08:22 -05:00
|
2022-11-30 06:10:41 -06:00
note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `from_ptr_range::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R9`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:79:34
2022-05-27 10:08:22 -05:00
|
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2022-12-09 09:56:23 -06:00
= note: `ptr_offset_from_unsigned` called on pointers into different allocations
2022-05-27 10:08:22 -05:00
|
2022-11-30 06:10:41 -06:00
note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `from_ptr_range::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R10`
2022-12-22 09:40:50 -06:00
--> $DIR/forbidden_slices.rs:80:35
2022-05-27 10:08:22 -05:00
|
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
2022-11-30 06:10:41 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^
2022-05-27 10:08:22 -05:00
error: aborting due to 18 previous errors
For more information about this error, try `rustc --explain E0080`.