diff options
Diffstat (limited to 'tests')
26 files changed, 397 insertions, 138 deletions
diff --git a/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff b/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff index 3d9852aef65..992b16fabf6 100644 --- a/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff +++ b/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff @@ -10,7 +10,8 @@ _2 = E::<char>::A; discriminant(_2) = 1; _1 = discriminant(_2); - switchInt(copy _1) -> [0: bb1, otherwise: bb2]; +- switchInt(copy _1) -> [0: bb1, otherwise: bb2]; ++ goto -> bb2; } bb1: { diff --git a/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff b/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff index c7af1638316..0600b751699 100644 --- a/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff +++ b/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff @@ -10,7 +10,8 @@ _2 = E::<T>::A; discriminant(_2) = 1; _1 = discriminant(_2); - switchInt(copy _1) -> [0: bb1, otherwise: bb2]; +- switchInt(copy _1) -> [0: bb1, otherwise: bb2]; ++ goto -> bb2; } bb1: { diff --git a/tests/mir-opt/set_no_discriminant.rs b/tests/mir-opt/set_no_discriminant.rs index 586e28ae426..c44575a4d61 100644 --- a/tests/mir-opt/set_no_discriminant.rs +++ b/tests/mir-opt/set_no_discriminant.rs @@ -1,5 +1,6 @@ // `SetDiscriminant` does not actually write anything if the chosen variant is the untagged variant -// of a niche encoding. Verify that we do not thread over this case. +// of a niche encoding. However, it is UB to call `SetDiscriminant` with the untagged variant if the +// value currently encodes a different variant. Verify that we do correctly thread in this case. //@ test-mir-pass: JumpThreading #![feature(custom_mir)] @@ -16,20 +17,21 @@ enum E<T> { #[custom_mir(dialect = "runtime")] pub fn f() -> usize { // CHECK-LABEL: fn f( - // CHECK-NOT: goto - // CHECK: switchInt( - // CHECK-NOT: goto + // CHECK-NOT: switchInt + // CHECK: goto + // CHECK-NOT: switchInt mir! { let a: isize; let e: E<char>; { e = E::A; - SetDiscriminant(e, 1); + SetDiscriminant(e, 1); // UB! a = Discriminant(e); match a { 0 => bb0, _ => bb1, } + } bb0 = { RET = 0; @@ -46,15 +48,15 @@ pub fn f() -> usize { #[custom_mir(dialect = "runtime")] pub fn generic<T>() -> usize { // CHECK-LABEL: fn generic( - // CHECK-NOT: goto - // CHECK: switchInt( - // CHECK-NOT: goto + // CHECK-NOT: switchInt + // CHECK: goto + // CHECK-NOT: switchInt mir! { let a: isize; let e: E<T>; { e = E::A; - SetDiscriminant(e, 1); + SetDiscriminant(e, 1); // UB! a = Discriminant(e); match a { 0 => bb0, @@ -72,6 +74,7 @@ pub fn generic<T>() -> usize { } } +// CHECK-LABEL: fn main( fn main() { assert_eq!(f(), 0); assert_eq!(generic::<char>(), 0); diff --git a/tests/ui/abi/c-zst.aarch64-darwin.stderr b/tests/ui/abi/c-zst.aarch64-darwin.stderr index 7d384bc875f..aae92bd7dc9 100644 --- a/tests/ui/abi/c-zst.aarch64-darwin.stderr +++ b/tests/ui/abi/c-zst.aarch64-darwin.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -45,7 +47,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/c-zst.powerpc-linux.stderr b/tests/ui/abi/c-zst.powerpc-linux.stderr index 7980710bab6..4ff4a8b90cf 100644 --- a/tests/ui/abi/c-zst.powerpc-linux.stderr +++ b/tests/ui/abi/c-zst.powerpc-linux.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -56,7 +58,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/c-zst.s390x-linux.stderr b/tests/ui/abi/c-zst.s390x-linux.stderr index 7980710bab6..4ff4a8b90cf 100644 --- a/tests/ui/abi/c-zst.s390x-linux.stderr +++ b/tests/ui/abi/c-zst.s390x-linux.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -56,7 +58,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/c-zst.sparc64-linux.stderr b/tests/ui/abi/c-zst.sparc64-linux.stderr index 7980710bab6..4ff4a8b90cf 100644 --- a/tests/ui/abi/c-zst.sparc64-linux.stderr +++ b/tests/ui/abi/c-zst.sparc64-linux.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -56,7 +58,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/c-zst.x86_64-linux.stderr b/tests/ui/abi/c-zst.x86_64-linux.stderr index 7d384bc875f..aae92bd7dc9 100644 --- a/tests/ui/abi/c-zst.x86_64-linux.stderr +++ b/tests/ui/abi/c-zst.x86_64-linux.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -45,7 +47,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr index 7980710bab6..4ff4a8b90cf 100644 --- a/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr +++ b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -56,7 +58,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/debug.stderr b/tests/ui/abi/debug.stderr index aa51c42c58d..0cbdf366616 100644 --- a/tests/ui/abi/debug.stderr +++ b/tests/ui/abi/debug.stderr @@ -21,7 +21,9 @@ error: fn_abi_of(test) = FnAbi { fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -67,7 +69,9 @@ error: fn_abi_of(test) = FnAbi { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -124,7 +128,9 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -161,7 +167,9 @@ error: fn_abi_of(TestFnPtr) = FnAbi { fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -210,7 +218,9 @@ error: fn_abi_of(test_generic) = FnAbi { fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -244,7 +254,9 @@ error: fn_abi_of(test_generic) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -292,7 +304,9 @@ error: ABIs are not compatible fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -326,7 +340,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -362,7 +378,9 @@ error: ABIs are not compatible fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -396,7 +414,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -435,7 +455,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -473,7 +495,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -506,7 +530,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -544,7 +570,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -585,7 +613,9 @@ error: ABIs are not compatible fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -619,7 +649,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -655,7 +687,9 @@ error: ABIs are not compatible fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -689,7 +723,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -731,7 +767,9 @@ error: ABIs are not compatible fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -765,7 +803,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -801,7 +841,9 @@ error: ABIs are not compatible fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -835,7 +877,9 @@ error: ABIs are not compatible }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -902,7 +946,9 @@ error: fn_abi_of(assoc_test) = FnAbi { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -938,7 +984,9 @@ error: fn_abi_of(assoc_test) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/sysv64-zst.stderr b/tests/ui/abi/sysv64-zst.stderr index 8e1791e27d2..920963c6987 100644 --- a/tests/ui/abi/sysv64-zst.stderr +++ b/tests/ui/abi/sysv64-zst.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -45,7 +47,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/win64-zst.x86_64-linux.stderr b/tests/ui/abi/win64-zst.x86_64-linux.stderr index 76d90670eb1..2752555b4f3 100644 --- a/tests/ui/abi/win64-zst.x86_64-linux.stderr +++ b/tests/ui/abi/win64-zst.x86_64-linux.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -45,7 +47,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/win64-zst.x86_64-windows-gnu.stderr b/tests/ui/abi/win64-zst.x86_64-windows-gnu.stderr index 7ee90e24744..19abb5930b1 100644 --- a/tests/ui/abi/win64-zst.x86_64-windows-gnu.stderr +++ b/tests/ui/abi/win64-zst.x86_64-windows-gnu.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -56,7 +58,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/abi/win64-zst.x86_64-windows-msvc.stderr b/tests/ui/abi/win64-zst.x86_64-windows-msvc.stderr index 76d90670eb1..2752555b4f3 100644 --- a/tests/ui/abi/win64-zst.x86_64-windows-msvc.stderr +++ b/tests/ui/abi/win64-zst.x86_64-windows-msvc.stderr @@ -18,7 +18,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, @@ -45,7 +47,9 @@ error: fn_abi_of(pass_zst) = FnAbi { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index bd31665dac1..8ae2933c427 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -57,7 +57,9 @@ error: layout_of(E) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -83,7 +85,9 @@ error: layout_of(E) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -134,7 +138,9 @@ error: layout_of(S) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -158,7 +164,9 @@ error: layout_of(U) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -251,7 +259,9 @@ error: layout_of(Result<i32, i32>) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -288,7 +298,9 @@ error: layout_of(Result<i32, i32>) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -321,7 +333,9 @@ error: layout_of(i32) = Layout { fields: Primitive, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -345,7 +359,9 @@ error: layout_of(V) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), @@ -369,7 +385,9 @@ error: layout_of(W) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), @@ -393,7 +411,9 @@ error: layout_of(Y) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), @@ -417,7 +437,9 @@ error: layout_of(P1) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -441,7 +463,9 @@ error: layout_of(P2) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -465,7 +489,9 @@ error: layout_of(P3) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -489,7 +515,9 @@ error: layout_of(P4) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -518,7 +546,9 @@ error: layout_of(P5) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -547,7 +577,9 @@ error: layout_of(MaybeUninit<u8>) = Layout { ), largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), diff --git a/tests/ui/layout/hexagon-enum.stderr b/tests/ui/layout/hexagon-enum.stderr index 59fe667923f..a934f270911 100644 --- a/tests/ui/layout/hexagon-enum.stderr +++ b/tests/ui/layout/hexagon-enum.stderr @@ -57,7 +57,9 @@ error: layout_of(A) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -131,7 +133,9 @@ error: layout_of(B) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -205,7 +209,9 @@ error: layout_of(C) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), @@ -279,7 +285,9 @@ error: layout_of(P) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -353,7 +361,9 @@ error: layout_of(T) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), diff --git a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr index ca041fb539b..8b4e46de845 100644 --- a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr +++ b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr @@ -79,7 +79,9 @@ error: layout_of(MissingPayloadField) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -99,7 +101,9 @@ error: layout_of(MissingPayloadField) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -197,7 +201,9 @@ error: layout_of(CommonPayloadField) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -234,7 +240,9 @@ error: layout_of(CommonPayloadField) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -330,7 +338,9 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -366,7 +376,9 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -478,7 +490,9 @@ error: layout_of(NicheFirst) = Layout { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -498,7 +512,9 @@ error: layout_of(NicheFirst) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -518,7 +534,9 @@ error: layout_of(NicheFirst) = Layout { }, largest_niche: None, variants: Single { - index: 2, + index: Some( + 2, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -630,7 +648,9 @@ error: layout_of(NicheSecond) = Layout { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -650,7 +670,9 @@ error: layout_of(NicheSecond) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -670,7 +692,9 @@ error: layout_of(NicheSecond) = Layout { }, largest_niche: None, variants: Single { - index: 2, + index: Some( + 2, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), diff --git a/tests/ui/layout/issue-96185-overaligned-enum.stderr b/tests/ui/layout/issue-96185-overaligned-enum.stderr index bc40a2aa482..92643445595 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.stderr +++ b/tests/ui/layout/issue-96185-overaligned-enum.stderr @@ -51,7 +51,9 @@ error: layout_of(Aligned1) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: Some( Align(8 bytes), @@ -73,7 +75,9 @@ error: layout_of(Aligned1) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: Some( Align(8 bytes), @@ -151,7 +155,9 @@ error: layout_of(Aligned2) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: Some( Align(1 bytes), @@ -173,7 +179,9 @@ error: layout_of(Aligned2) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: Some( Align(1 bytes), diff --git a/tests/ui/layout/thumb-enum.stderr b/tests/ui/layout/thumb-enum.stderr index bf043af586b..f35cf0dab3d 100644 --- a/tests/ui/layout/thumb-enum.stderr +++ b/tests/ui/layout/thumb-enum.stderr @@ -57,7 +57,9 @@ error: layout_of(A) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -131,7 +133,9 @@ error: layout_of(B) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -205,7 +209,9 @@ error: layout_of(C) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), @@ -279,7 +285,9 @@ error: layout_of(P) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -353,7 +361,9 @@ error: layout_of(T) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), diff --git a/tests/ui/layout/zero-sized-array-enum-niche.stderr b/tests/ui/layout/zero-sized-array-enum-niche.stderr index d61408098df..4c6f636b267 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.stderr +++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr @@ -55,7 +55,9 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -88,7 +90,9 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { }, ), variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -160,7 +164,9 @@ error: layout_of(MultipleAlignments) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), @@ -184,7 +190,9 @@ error: layout_of(MultipleAlignments) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -217,7 +225,9 @@ error: layout_of(MultipleAlignments) = Layout { }, ), variants: Single { - index: 2, + index: Some( + 2, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -289,7 +299,9 @@ error: layout_of(Result<[u32; 0], Packed<NonZero<u16>>>) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -322,7 +334,9 @@ error: layout_of(Result<[u32; 0], Packed<NonZero<u16>>>) = Layout { }, ), variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -398,7 +412,9 @@ error: layout_of(Result<[u32; 0], Packed<U16IsZero>>) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -431,7 +447,9 @@ error: layout_of(Result<[u32; 0], Packed<U16IsZero>>) = Layout { }, ), variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), diff --git a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr index 64a0cb7f31a..08fd4237eeb 100644 --- a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr +++ b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr @@ -51,7 +51,9 @@ error: layout_of(Univariant) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -133,7 +135,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -169,7 +173,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -241,7 +247,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: Some( Align(8 bytes), @@ -267,7 +275,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), diff --git a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr index 5c4daa6d519..473268cac1a 100644 --- a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr +++ b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr @@ -51,7 +51,9 @@ error: layout_of(Univariant) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -133,7 +135,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -169,7 +173,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -241,7 +247,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: Some( Align(8 bytes), @@ -267,7 +275,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), diff --git a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr index 64a0cb7f31a..08fd4237eeb 100644 --- a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr +++ b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr @@ -51,7 +51,9 @@ error: layout_of(Univariant) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -133,7 +135,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -169,7 +173,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -241,7 +247,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: Some( Align(8 bytes), @@ -267,7 +275,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), diff --git a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr index 64a0cb7f31a..08fd4237eeb 100644 --- a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr +++ b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr @@ -51,7 +51,9 @@ error: layout_of(Univariant) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -133,7 +135,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -169,7 +173,9 @@ error: layout_of(TwoVariants) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -241,7 +247,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: Some( Align(8 bytes), @@ -267,7 +275,9 @@ error: layout_of(DeadBranchHasOtherField) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), diff --git a/tests/ui/repr/repr-c-int-dead-variants.stderr b/tests/ui/repr/repr-c-int-dead-variants.stderr index 75005a64523..1200f120d37 100644 --- a/tests/ui/repr/repr-c-int-dead-variants.stderr +++ b/tests/ui/repr/repr-c-int-dead-variants.stderr @@ -51,7 +51,9 @@ error: layout_of(UnivariantU8) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -133,7 +135,9 @@ error: layout_of(TwoVariantsU8) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -169,7 +173,9 @@ error: layout_of(TwoVariantsU8) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -241,7 +247,9 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: Some( Align(8 bytes), @@ -267,7 +275,9 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout { }, largest_niche: None, variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), diff --git a/tests/ui/type/pattern_types/range_patterns.stderr b/tests/ui/type/pattern_types/range_patterns.stderr index 0eed7c2ce1c..9954471968d 100644 --- a/tests/ui/type/pattern_types/range_patterns.stderr +++ b/tests/ui/type/pattern_types/range_patterns.stderr @@ -32,7 +32,9 @@ error: layout_of(NonZero<u32>) = Layout { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -69,7 +71,9 @@ error: layout_of((u32) is 1..=) = Layout { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -133,7 +137,9 @@ error: layout_of(Option<(u32) is 1..=>) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -172,7 +178,9 @@ error: layout_of(Option<(u32) is 1..=>) = Layout { }, ), variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -241,7 +249,9 @@ error: layout_of(Option<NonZero<u32>>) = Layout { }, largest_niche: None, variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), @@ -280,7 +290,9 @@ error: layout_of(Option<NonZero<u32>>) = Layout { }, ), variants: Single { - index: 1, + index: Some( + 1, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), @@ -329,7 +341,9 @@ error: layout_of(NonZeroU32New) = Layout { }, ), variants: Single { - index: 0, + index: Some( + 0, + ), }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), |
