diff --git a/src/test/ui/consts/const-eval/double_check.rs b/src/test/ui/consts/const-eval/double_check.rs index 81f6e7ddd2de2..76f9276c05807 100644 --- a/src/test/ui/consts/const-eval/double_check.rs +++ b/src/test/ui/consts/const-eval/double_check.rs @@ -21,12 +21,12 @@ enum Bar { union Union { foo: &'static Foo, bar: &'static Bar, - usize: &'static usize, + u8: &'static u8, } -static BAR: usize = 42; +static BAR: u8 = 42; static FOO: (&Foo, &Bar) = unsafe {( - Union { usize: &BAR }.foo, - Union { usize: &BAR }.bar, + Union { u8: &BAR }.foo, + Union { u8: &BAR }.bar, )}; fn main() {} diff --git a/src/test/ui/consts/const-eval/double_check2.rs b/src/test/ui/consts/const-eval/double_check2.rs index b661ee92475e6..701632362ce7a 100644 --- a/src/test/ui/consts/const-eval/double_check2.rs +++ b/src/test/ui/consts/const-eval/double_check2.rs @@ -19,12 +19,12 @@ enum Bar { union Union { foo: &'static Foo, bar: &'static Bar, - usize: &'static usize, + u8: &'static u8, } -static BAR: usize = 5; +static BAR: u8 = 5; static FOO: (&Foo, &Bar) = unsafe {( //~ undefined behavior - Union { usize: &BAR }.foo, - Union { usize: &BAR }.bar, + Union { u8: &BAR }.foo, + Union { u8: &BAR }.bar, )}; fn main() {} diff --git a/src/test/ui/consts/const-eval/double_check2.stderr b/src/test/ui/consts/const-eval/double_check2.stderr index 9dd7570232d37..28825477c8102 100644 --- a/src/test/ui/consts/const-eval/double_check2.stderr +++ b/src/test/ui/consts/const-eval/double_check2.stderr @@ -2,8 +2,8 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/double_check2.rs:25:1 | LL | / static FOO: (&Foo, &Bar) = unsafe {( //~ undefined behavior -LL | | Union { usize: &BAR }.foo, -LL | | Union { usize: &BAR }.bar, +LL | | Union { u8: &BAR }.foo, +LL | | Union { u8: &BAR }.bar, LL | | )}; | |___^ type validation failed: encountered invalid enum discriminant 5 at .1. |