| error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer |
| --> $DIR/ub-incorrect-vtable.rs:18:1 |
| | |
| LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait = |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
| | |
| = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼ |
| } |
| |
| error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer |
| --> $DIR/ub-incorrect-vtable.rs:22:1 |
| | |
| LL | const INVALID_VTABLE_SIZE: &dyn Trait = |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
| | |
| = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼ |
| } |
| |
| error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered ALLOC$ID<imm>, but expected a vtable pointer |
| --> $DIR/ub-incorrect-vtable.rs:31:1 |
| | |
| LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> = |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
| | |
| = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼ |
| } |
| |
| error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered ALLOC$ID<imm>, but expected a vtable pointer |
| --> $DIR/ub-incorrect-vtable.rs:35:1 |
| | |
| LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> = |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
| | |
| = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼ |
| } |
| |
| error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered ALLOC$ID<imm>, but expected a vtable pointer |
| --> $DIR/ub-incorrect-vtable.rs:40:1 |
| | |
| LL | const INVALID_VTABLE_UB: W<&dyn Trait> = |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
| | |
| = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼ |
| } |
| |
| error[E0080]: constructing invalid value of type Wide<'_>: at .1, encountered a dangling reference (going beyond the bounds of its allocation) |
| --> $DIR/ub-incorrect-vtable.rs:86:1 |
| | |
| LL | const G: Wide = unsafe { Transmute { t: FOO }.u }; |
| | ^^^^^^^^^^^^^ it is undefined behavior to use this value |
| | |
| = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼ |
| } |
| |
| error: aborting due to 6 previous errors |
| |
| For more information about this error, try `rustc --explain E0080`. |