From 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:03:36 +0200 Subject: Adding upstream version 1.65.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/consts/const-eval/union-ice.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/test/ui/consts/const-eval/union-ice.rs') diff --git a/src/test/ui/consts/const-eval/union-ice.rs b/src/test/ui/consts/const-eval/union-ice.rs index 4189619b2..dd970a355 100644 --- a/src/test/ui/consts/const-eval/union-ice.rs +++ b/src/test/ui/consts/const-eval/union-ice.rs @@ -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, ], -- cgit v1.2.3