fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0080]: evaluation of constant value failed 2 --> $DIR/detect-extra-ub.rs:29:20 3 | 4LL | let _x: bool = transmute(3u8); 5 | ^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean 6 7error[E0080]: evaluation of constant value failed 8 --> $DIR/detect-extra-ub.rs:35:21 9 | 10LL | let _x: usize = transmute(&3u8); 11 | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a pointer, but expected an integer 12 | 13 = help: this code performed an operation that depends on the underlying bytes representing a pointer 14 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported 15 16error[E0080]: evaluation of constant value failed 17 --> $DIR/detect-extra-ub.rs:41:28 18 | 19LL | let _x: PtrSizedEnum = transmute(&3u8); 20 | ^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered a pointer, but expected an integer 21 | 22 = help: this code performed an operation that depends on the underlying bytes representing a pointer 23 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported 24 25error[E0080]: evaluation of constant value failed 26 --> $DIR/detect-extra-ub.rs:48:30 27 | 28LL | let _x: (usize, usize) = transmute(x); 29 | ^^^^^^^^^^^^ constructing invalid value at .0: encountered a pointer, but expected an integer 30 | 31 = help: this code performed an operation that depends on the underlying bytes representing a pointer 32 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported 33 34error[E0080]: evaluation of constant value failed 35 --> $DIR/detect-extra-ub.rs:54:20 36 | 37LL | let _x: &u32 = transmute(&[0u8; 4]); 38 | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 4 byte alignment but found 1) 39 40error[E0080]: evaluation of constant value failed 41 --> $DIR/detect-extra-ub.rs:62:13 42 | 43LL | let v = *addr_of!(data).cast::<UninhDiscriminant>(); 44 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant 45 46error[E0080]: evaluation of constant value failed 47 --> $DIR/detect-extra-ub.rs:82:16 48 | 49LL | let _val = *(&mem as *const Align as *const [*const u8; 2]); 50 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a partial pointer or a mix of pointers 51 | 52 = help: this code performed an operation that depends on the underlying bytes representing a pointer 53 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported 54 55error: aborting due to 7 previous errors 56 57For more information about this error, try `rustc --explain E0080`.