diff options
| author | b-naber <b_naber@gmx.de> | 2023-07-03 20:55:37 +0000 |
|---|---|---|
| committer | b-naber <b_naber@gmx.de> | 2023-07-17 22:06:32 +0000 |
| commit | 843e2ee5d56907be94a68d3b3b6a2057f8abaaeb (patch) | |
| tree | 3e539303a810892c53304a091593a9f6e7f73edf | |
| parent | feb8bb127305f692e4b08b5b4f0eb21a0da79511 (diff) | |
| download | rust-843e2ee5d56907be94a68d3b3b6a2057f8abaaeb.tar.gz rust-843e2ee5d56907be94a68d3b3b6a2057f8abaaeb.zip | |
add test for nested pattern
| -rw-r--r-- | tests/ui/pattern/slice-patterns-nested.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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>(T); + +impl Into<[usize; 3]> for Zeroes { + fn into(self) -> [usize; 3] { + [0; 3] + } +} + +fn main() { + let Foo([a, b, c]) = Foo(Zeroes.into()); +} |
