╾───────ALLOC_ID───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:32:1
+error[E0080]: could not evaluate static initializer
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
-LL | pub static S7: &[u16] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+ = note: accessing memory with alignment 1, but alignment 2 is required
|
- = 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.
- = note: the raw bytes of the constant (size: 16, align: 8) {
- ╾─────ALLOC_ID+0x1─────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
- }
+note: inside `std::slice::from_raw_parts::<'_, u16>`
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
+note: inside `S7`
+ --> $DIR/forbidden_slices.rs:35:5
+ |
+LL | from_raw_parts(ptr, 4)
+ | ^^^^^^^^^^^^^^^^^^^^^^
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `std::slice::from_raw_parts::<'_, u64>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `S8`
- --> $DIR/forbidden_slices.rs:43:5
+ --> $DIR/forbidden_slices.rs:42:5
|
LL | from_raw_parts(ptr, 1)
| ^^^^^^^^^^^^^^^^^^^^^^
note: inside `from_ptr_range::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R0`
- --> $DIR/forbidden_slices.rs:46:34
+ --> $DIR/forbidden_slices.rs:45:34
|
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `from_ptr_range::<'_, ()>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R1`
- --> $DIR/forbidden_slices.rs:47:33
+ --> $DIR/forbidden_slices.rs:46:33
|
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `ptr::const_ptr::<impl *const u32>::add`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `R2`
- --> $DIR/forbidden_slices.rs:50:25
+ --> $DIR/forbidden_slices.rs:49:25
|
LL | from_ptr_range(ptr..ptr.add(2))
| ^^^^^^^^^^
error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:52:1
+ --> $DIR/forbidden_slices.rs:51:1
|
LL | pub static R4: &[u8] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:57:1
+ --> $DIR/forbidden_slices.rs:56:1
|
LL | pub static R5: &[u8] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:62:1
+ --> $DIR/forbidden_slices.rs:61:1
|
LL | pub static R6: &[bool] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
╾──────ALLOC_ID───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:67:1
+error[E0080]: could not evaluate static initializer
+ --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
-LL | pub static R7: &[u16] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+ = note: accessing memory with alignment 1, but alignment 2 is required
|
- = 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.
- = note: the raw bytes of the constant (size: 16, align: 8) {
- ╾────ALLOC_ID+0x1─────╼ 04 00 00 00 00 00 00 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`
+ --> $DIR/forbidden_slices.rs:68:5
+ |
+LL | from_ptr_range(ptr..ptr.add(4))
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `ptr::const_ptr::<impl *const u64>::add`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `R8`
- --> $DIR/forbidden_slices.rs:74:25
+ --> $DIR/forbidden_slices.rs:72:25
|
LL | from_ptr_range(ptr..ptr.add(1))
| ^^^^^^^^^^
note: inside `from_ptr_range::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R9`
- --> $DIR/forbidden_slices.rs:79:34
+ --> $DIR/forbidden_slices.rs:77:34
|
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `from_ptr_range::<'_, u32>`
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
note: inside `R10`
- --> $DIR/forbidden_slices.rs:80:35
+ --> $DIR/forbidden_slices.rs:78:35
|
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0080]: evaluation of constant value failed
- --> $DIR/copy-intrinsic.rs:27:5
+ --> $DIR/copy-intrinsic.rs:20:5
+ |
+LL | copy_nonoverlapping(&src as *const _ as *const i32, &mut dst as *mut _ as *mut i32, 0);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment 1, but alignment 4 is required
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/copy-intrinsic.rs:28:5
|
LL | copy_nonoverlapping(0x100 as *const i32, dangle, 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc5 has size 4, so pointer at offset 40 is out-of-bounds
error[E0080]: evaluation of constant value failed
- --> $DIR/copy-intrinsic.rs:34:5
+ --> $DIR/copy-intrinsic.rs:35:5
|
LL | copy_nonoverlapping(dangle, 0x100 as *mut i32, 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc7 has size 4, so pointer at offset 40 is out-of-bounds
error[E0080]: evaluation of constant value failed
- --> $DIR/copy-intrinsic.rs:41:5
+ --> $DIR/copy-intrinsic.rs:42:5
|
LL | copy(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy`
error[E0080]: evaluation of constant value failed
- --> $DIR/copy-intrinsic.rs:47:5
+ --> $DIR/copy-intrinsic.rs:48:5
|
LL | copy_nonoverlapping(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy_nonoverlapping`
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0080`.
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:9:20
+ --> $DIR/detect-extra-ub.rs:8:20
|
LL | let _x: bool = transmute(3u8);
| ^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:15:21
+ --> $DIR/detect-extra-ub.rs:14:21
|
LL | let _x: usize = transmute(&3u8);
| ^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:21:30
+ --> $DIR/detect-extra-ub.rs:20:30
|
LL | let _x: (usize, usize) = transmute(x);
| ^^^^^^^^^^^^ unable to turn pointer into raw bytes
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: evaluation of constant value failed
- --> $DIR/detect-extra-ub.rs:26:20
+ --> $DIR/detect-extra-ub.rs:25:20
|
LL | let _x: &u32 = transmute(&[0u8; 4]);
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 4 byte alignment but found 1)
note: inside `ptr::const_ptr::<impl *const u32>::read`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `INNER`
- --> $DIR/detect-extra-ub.rs:38:9
+ --> $DIR/detect-extra-ub.rs:37:9
|
LL | ptr.read();
| ^^^^^^^^^^
note: erroneous constant used
- --> $DIR/detect-extra-ub.rs:32:5
+ --> $DIR/detect-extra-ub.rs:31:5
|
LL | INNER;
| ^^^^^