|
| 1 | +error[E0080]: evaluation of constant value failed |
| 2 | + --> $DIR/detect-extra-ub.rs:9:20 |
| 3 | + | |
| 4 | +LL | let _x: bool = transmute(3u8); |
| 5 | + | ^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean |
| 6 | + |
| 7 | +error[E0080]: evaluation of constant value failed |
| 8 | + --> $DIR/detect-extra-ub.rs:15:21 |
| 9 | + | |
| 10 | +LL | let _x: usize = transmute(&3u8); |
| 11 | + | ^^^^^^^^^^^^^^^ constructing invalid value: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes |
| 12 | + |
| 13 | +error[E0080]: evaluation of constant value failed |
| 14 | + --> $DIR/detect-extra-ub.rs:22:30 |
| 15 | + | |
| 16 | +LL | let _x: (usize, usize) = transmute(x); |
| 17 | + | ^^^^^^^^^^^^ constructing invalid value at .0: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes |
| 18 | + |
| 19 | +error[E0080]: evaluation of constant value failed |
| 20 | + --> $DIR/detect-extra-ub.rs:28:20 |
| 21 | + | |
| 22 | +LL | let _x: &u32 = transmute(&[0u8; 4]); |
| 23 | + | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 4 byte alignment but found 1) |
| 24 | + |
| 25 | +error[E0080]: evaluation of constant value failed |
| 26 | + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL |
| 27 | + | |
| 28 | +LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); |
| 29 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 30 | + | | |
| 31 | + | accessing memory with alignment 1, but alignment 4 is required |
| 32 | + | inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL |
| 33 | + | |
| 34 | + ::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL |
| 35 | + | |
| 36 | +LL | unsafe { read(self) } |
| 37 | + | ---------- inside `ptr::const_ptr::<impl *const u32>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL |
| 38 | + | |
| 39 | + ::: $DIR/detect-extra-ub.rs:41:9 |
| 40 | + | |
| 41 | +LL | ptr.read(); |
| 42 | + | ---------- inside `INNER` at $DIR/detect-extra-ub.rs:41:9 |
| 43 | + |
| 44 | +error: any use of this value will cause an error |
| 45 | + --> $DIR/detect-extra-ub.rs:34:5 |
| 46 | + | |
| 47 | +LL | const UNALIGNED_READ: () = { |
| 48 | + | ------------------------ |
| 49 | +LL | INNER; |
| 50 | + | ^^^^^ referenced constant has errors |
| 51 | + | |
| 52 | + = note: `#[deny(const_err)]` on by default |
| 53 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 54 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
| 55 | + |
| 56 | +error: aborting due to 6 previous errors |
| 57 | + |
| 58 | +For more information about this error, try `rustc --explain E0080`. |
| 59 | +Future incompatibility report: Future breakage diagnostic: |
| 60 | +error: any use of this value will cause an error |
| 61 | + --> $DIR/detect-extra-ub.rs:34:5 |
| 62 | + | |
| 63 | +LL | const UNALIGNED_READ: () = { |
| 64 | + | ------------------------ |
| 65 | +LL | INNER; |
| 66 | + | ^^^^^ referenced constant has errors |
| 67 | + | |
| 68 | + = note: `#[deny(const_err)]` on by default |
| 69 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 70 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
| 71 | + |
0 commit comments