|
| 1 | +error[E0080]: it is undefined behavior to use this value |
| 2 | + --> $DIR/validity.rs:8:1 |
| 3 | + | |
| 4 | +LL | const BAD: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(0) }; |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 |
| 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 rustc repository if you believe it should not be considered undefined behavior. |
| 8 | + = note: the raw bytes of the constant (size: 4, align: 4) { |
| 9 | + 00 00 00 00 │ .... |
| 10 | + } |
| 11 | + |
| 12 | +error[E0080]: it is undefined behavior to use this value |
| 13 | + --> $DIR/validity.rs:11:1 |
| 14 | + | |
| 15 | +LL | const BAD_AGGREGATE: (pattern_type!(u32 is 1..), u32) = (unsafe { std::mem::transmute(0) }, 0); |
| 16 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 |
| 17 | + | |
| 18 | + = 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. |
| 19 | + = note: the raw bytes of the constant (size: 8, align: 4) { |
| 20 | + 00 00 00 00 00 00 00 00 │ ........ |
| 21 | + } |
| 22 | + |
| 23 | +error[E0080]: it is undefined behavior to use this value |
| 24 | + --> $DIR/validity.rs:17:1 |
| 25 | + | |
| 26 | +LL | const BAD_FOO: Foo = Foo(Bar(unsafe { std::mem::transmute(0) })); |
| 27 | + | ^^^^^^^^^^^^^^^^^^ constructing invalid value at .0.0: encountered 0, but expected something greater or equal to 1 |
| 28 | + | |
| 29 | + = 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. |
| 30 | + = note: the raw bytes of the constant (size: 4, align: 4) { |
| 31 | + 00 00 00 00 │ .... |
| 32 | + } |
| 33 | + |
| 34 | +error: aborting due to 3 previous errors |
| 35 | + |
| 36 | +For more information about this error, try `rustc --explain E0080`. |
0 commit comments