blob: e8a7b2f500561e31cbee5926bd8b7d8893e1d003 [file] [log] [blame]
error: this constant cannot be used
--> $DIR/union-ice.rs:23:1
|
LL | const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR this constant cannot be used
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to read undefined bytes
|
= note: #[deny(const_err)] on by default
error: this constant cannot be used
--> $DIR/union-ice.rs:25:1
|
LL | / const FIELD_PATH: Struct = Struct { //~ ERROR this constant cannot be used
LL | | a: 42,
LL | | b: unsafe { UNION.field3 },
LL | | };
| |__^ attempted to read undefined bytes
error[E0080]: this constant likely exhibits undefined behavior
--> $DIR/union-ice.rs:35:1
|
LL | / const FIELD_PATH2: Struct2 = Struct2 { //~ ERROR this constant likely exhibits undefined behavior
LL | | b: [
LL | | 21,
LL | | unsafe { UNION.field3 },
... |
LL | | a: 42,
LL | | };
| |__^ type validation failed: encountered undefined bytes at .b[1]
|
= 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`.