]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/consts/const-eval/union-ice.stderr
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / union-ice.stderr
index 7f77f2c16aeb0a615ffd436028fea76a7dfad22e..21a54550900bb923d78d5be6a3c42d98e3dbfd78 100644 (file)
@@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ice.rs:14:1
    |
 LL | const FIELD3: Field3 = unsafe { UNION.field3 };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized bytes
+   | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
    |
    = 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: 8, align: 8) {
@@ -12,11 +12,8 @@ LL | const FIELD3: Field3 = unsafe { UNION.field3 };
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ice.rs:16:1
    |
-LL | / const FIELD_PATH: Struct = Struct {
-LL | |     a: 42,
-LL | |     b: unsafe { UNION.field3 },
-LL | | };
-   | |__^ type validation failed at .b: encountered uninitialized bytes, but expected initialized bytes
+LL | const FIELD_PATH: Struct = Struct {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b: encountered uninitialized bytes, but expected initialized bytes
    |
    = 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) {
@@ -26,14 +23,8 @@ LL | | };
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ice.rs:26:1
    |
-LL | / const FIELD_PATH2: Struct2 = Struct2 {
-LL | |     b: [
-LL | |         21,
-LL | |         unsafe { UNION.field3 },
-...  |
-LL | |     a: 42,
-LL | | };
-   | |__^ type validation failed at .b[1]: encountered uninitialized bytes
+LL | const FIELD_PATH2: Struct2 = Struct2 {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b[1]: encountered uninitialized bytes
    |
    = 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: 40, align: 8) {