diff --git a/tests/ui/pattern/slice-patterns-nested.rs b/tests/ui/pattern/slice-patterns-nested.rs new file mode 100644 index 00000000000..077e0a13954 --- /dev/null +++ b/tests/ui/pattern/slice-patterns-nested.rs @@ -0,0 +1,15 @@ +// check-pass +#![allow(unused_variables)] + +struct Zeroes; +struct Foo(T); + +impl Into<[usize; 3]> for Zeroes { + fn into(self) -> [usize; 3] { + [0; 3] + } +} + +fn main() { + let Foo([a, b, c]) = Foo(Zeroes.into()); +}