]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0080]: this constant likely exhibits undefined behavior |
b7449926 | 2 | --> $DIR/ub-enum.rs:22:1 |
8faf50e0 | 3 | | |
b7449926 XL |
4 | LL | const BAD_ENUM: Enum = unsafe { TransmuteEnum { a: &1 }.b }; |
5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer enum discriminant | |
8faf50e0 XL |
6 | | |
7 | = 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 | |
8 | ||
9 | error[E0080]: this constant likely exhibits undefined behavior | |
b7449926 | 10 | --> $DIR/ub-enum.rs:35:1 |
8faf50e0 | 11 | | |
b7449926 XL |
12 | LL | const BAD_ENUM2 : Enum2 = unsafe { TransmuteEnum2 { a: 0 }.b }; |
13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid enum discriminant 0 | |
8faf50e0 XL |
14 | | |
15 | = 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 | |
16 | ||
17 | error[E0080]: this constant likely exhibits undefined behavior | |
b7449926 | 18 | --> $DIR/ub-enum.rs:45:1 |
8faf50e0 | 19 | | |
b7449926 | 20 | LL | const BAD_ENUM_CHAR : Option<(char, char)> = Some(('x', unsafe { TransmuteChar { a: !0 }.b })); |
0bf4aa26 | 21 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 4294967295 at .Some.0.1, but expected something in the range 0..=1114111 |
8faf50e0 XL |
22 | | |
23 | = 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 | |
24 | ||
25 | error: aborting due to 3 previous errors | |
26 | ||
27 | For more information about this error, try `rustc --explain E0080`. |