Skip to content

Commit 5a9af37

Browse files
committed
address review
1 parent e1e7553 commit 5a9af37

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/ui/pattern/slice-patterns-irrefutable.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn array_try_from(x: &[usize]) -> Result<usize, TryFromSliceError> {
3232
Ok(a + b)
3333
}
3434

35-
fn default() {
35+
fn destructuring_assignment() {
3636
let a: i32;
3737
let b;
3838
[a, b] = Default::default();
@@ -45,6 +45,18 @@ fn test_nested_array() {
4545
[a, b] = Default::default();
4646
}
4747

48+
fn test_nested_array_type_hint() {
49+
let a: [_; 3];
50+
let b;
51+
[a, b] = Default::default();
52+
let _: i32 = b[1];
53+
}
54+
55+
fn test_working_nested_array() {
56+
let a: i32;
57+
[[a, _, _], _, _] = Default::default();
58+
}
59+
4860
struct Foo<T>([T; 2]);
4961

5062
impl<T: Default + Copy> Default for Foo<T> {

0 commit comments

Comments
 (0)