address review

This commit is contained in:
b-naber 2023-07-28 11:20:11 +00:00
parent e1e755311a
commit 5a9af37370

View file

@ -32,7 +32,7 @@ fn array_try_from(x: &[usize]) -> Result<usize, TryFromSliceError> {
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>([T; 2]);
impl<T: Default + Copy> Default for Foo<T> {