From 5a9af37370bc220bc395939d878c64547e3466d0 Mon Sep 17 00:00:00 2001 From: b-naber Date: Fri, 28 Jul 2023 11:20:11 +0000 Subject: [PATCH] address review --- tests/ui/pattern/slice-patterns-irrefutable.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/ui/pattern/slice-patterns-irrefutable.rs b/tests/ui/pattern/slice-patterns-irrefutable.rs index 7be02b44e43d7..bd230608eb5ca 100644 --- a/tests/ui/pattern/slice-patterns-irrefutable.rs +++ b/tests/ui/pattern/slice-patterns-irrefutable.rs @@ -32,7 +32,7 @@ fn array_try_from(x: &[usize]) -> Result { Ok(a + b) } -fn default() { +fn destructuring_assignment() { let a: i32; let b; [a, b] = Default::default(); @@ -45,6 +45,18 @@ fn test_nested_array() { [a, b] = Default::default(); } +fn test_nested_array_type_hint() { + let a: [_; 3]; + let b; + [a, b] = Default::default(); + let _: i32 = b[1]; +} + +fn test_working_nested_array() { + let a: i32; + [[a, _, _], _, _] = Default::default(); +} + struct Foo([T; 2]); impl Default for Foo {