Closed
Description
The length of fixed length vectors does not change, so a single pattern should be considered exhaustive.
Function argument destructuring:
fn foo<T>([x, y, z]: [T,..3]) -> (T, T, T) { (x, y, z) }
<anon>:7:19: 7:28 error: refutable pattern in function argument
<anon>:7 fn foo<T>([x, y, z]: [T,..3]) -> (T, T, T) { (x, y, z) }
^~~~~~~~~
Let destructuring:
let [x, y, z] = [1, 2, 3];
<anon>:7:13: 7:22 error: refutable pattern in local binding
<anon>:7 let [x, y, z] = [1, 2, 3];
^~~~~~~~~
Match patterns:
match [1, 2, 3] { [x, y, z] => (x, y, z) }
<anon>:7:9: 7:51 error: non-exhaustive patterns: vectors of length 0 not covered
<anon>:7 match [1, 2, 3] { [x, y, z] => (x, y, z) }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~