28 lines
1.8 KiB
Plaintext
28 lines
1.8 KiB
Plaintext
error[E0080]: it is undefined behavior to use this value
|
|
--> $DIR/ub-enum.rs:24:1
|
|
|
|
|
LL | const BAD_ENUM: Enum = unsafe { TransmuteEnum { a: &1 }.b };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected a valid enum discriminant
|
|
|
|
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
|
|
|
error[E0080]: it is undefined behavior to use this value
|
|
--> $DIR/ub-enum.rs:37:1
|
|
|
|
|
LL | const BAD_ENUM2 : Enum2 = unsafe { TransmuteEnum2 { a: 0 }.b };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected a valid enum discriminant
|
|
|
|
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
|
|
|
error[E0080]: it is undefined behavior to use this value
|
|
--> $DIR/ub-enum.rs:47:1
|
|
|
|
|
LL | const BAD_ENUM_CHAR : Option<(char, char)> = Some(('x', unsafe { TransmuteChar { a: !0 }.b }));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 4294967295 at .Some.0.1, but expected something in the range 0..=1114111
|
|
|
|
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0080`.
|