You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn foo(p: [u8, ..4]) {
match p {
[a, b, c, d] => {},
};
}
Compiler reports non-exhaustive matching:
/.../tmp3.rs:2:4: 4:5 error: non-exhaustive patterns: vectors of length 0 not covered
/.../tmp3.rs:2 match p {
/.../tmp3.rs:3 [a, b, c, d] => {},
/.../tmp3.rs:4 };
error: aborting due to previous error
It is not possible p to have size 0.
Fixed length vectors should also be allowed in let statements:
let [a, b, c] = [1, 2, 3]; // currently reports error: refutable pattern in local binding