]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/consts/const-eval/union-ice.rs
Rollup merge of #104461 - mati865:gnullvm-aarch64-fixup, r=Mark-Simulacrum
[rust.git] / src / test / ui / consts / const-eval / union-ice.rs
index 4189619b2aabef297cee9c35160fb1697d2f4a62..dd970a355626ce0fd75e18c7c372f4846b87b947 100644 (file)
@@ -11,11 +11,15 @@ union DummyUnion {
 
 const UNION: DummyUnion = DummyUnion { field1: 1065353216 };
 
-const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR it is undefined behavior to use this value
+const FIELD3: Field3 = unsafe { UNION.field3 };
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
 
-const FIELD_PATH: Struct = Struct { //~ ERROR it is undefined behavior to use this value
+const FIELD_PATH: Struct = Struct {
     a: 42,
     b: unsafe { UNION.field3 },
+    //~^ ERROR evaluation of constant value failed
+    //~| uninitialized
 };
 
 struct Struct {
@@ -23,10 +27,12 @@ struct Struct {
     b: Field3,
 }
 
-const FIELD_PATH2: Struct2 = Struct2 { //~ ERROR it is undefined behavior to use this value
+const FIELD_PATH2: Struct2 = Struct2 {
     b: [
         21,
         unsafe { UNION.field3 },
+        //~^ ERROR evaluation of constant value failed
+        //~| uninitialized
         23,
         24,
     ],