fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0080]: evaluation of constant value failed 2 --> $DIR/ub-incorrect-vtable.rs:19:14 3 | 4LL | unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) }; 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable 6 7error[E0080]: evaluation of constant value failed 8 --> $DIR/ub-incorrect-vtable.rs:24:14 9 | 10LL | unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) }; 11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable 12 13error[E0080]: it is undefined behavior to use this value 14 --> $DIR/ub-incorrect-vtable.rs:33:1 15 | 16LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> = 17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer 18 | 19 = 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. 20 = note: the raw bytes of the constant (size: 8, align: 4) { 21 ╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼ 22 } 23 24error[E0080]: it is undefined behavior to use this value 25 --> $DIR/ub-incorrect-vtable.rs:38:1 26 | 27LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> = 28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer 29 | 30 = 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. 31 = note: the raw bytes of the constant (size: 8, align: 4) { 32 ╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼ 33 } 34 35error[E0080]: it is undefined behavior to use this value 36 --> $DIR/ub-incorrect-vtable.rs:44:1 37 | 38LL | const INVALID_VTABLE_UB: W<&dyn Trait> = 39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer 40 | 41 = 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. 42 = note: the raw bytes of the constant (size: 8, align: 4) { 43 ╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼ 44 } 45 46error[E0080]: it is undefined behavior to use this value 47 --> $DIR/ub-incorrect-vtable.rs:91:1 48 | 49LL | const G: Wide = unsafe { Transmute { t: FOO }.u }; 50 | ^^^^^^^^^^^^^ constructing invalid value at .1: encountered a dangling reference (going beyond the bounds of its allocation) 51 | 52 = 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. 53 = note: the raw bytes of the constant (size: 8, align: 4) { 54 ╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼ 55 } 56 57error: aborting due to 6 previous errors 58 59For more information about this error, try `rustc --explain E0080`.