-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect non-exhaustive matching for fixed length arrays #8311
Comments
stepancheg
added a commit
to stepancheg/rust
that referenced
this issue
Aug 8, 2013
Code like this is fixed now: ``` fn foo(p: [u8, ..4]) { match p { [a, b, c, d] => {} }; } ``` Invalid constructors are not reported as errors yet: ``` fn foo(p: [u8, ..4]) { match p { [_, _, _] => {} // this should be error [_, _, _, _, _, .._] => {} // and this _ => {} } } ``` Issue rust-lang#8311 is partially fixed by this commit. Fixed-length arrays in let statement are not yet allowed: ``` let [a, b, c] = [1, 2, 3]; // still fails ```
I tested this issue. No more bugs. I think we should closed this issue.
|
The pull request states that it wasn't a full fix because |
Closing in favour of #7784. |
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jan 27, 2022
fix `needless_question_mark` not considering async fn closes rust-lang#8277 changelog: [`needless_question_mark`] Fix FN on async functions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler reports non-exhaustive matching:
It is not possible p to have size 0.
Fixed length vectors should also be allowed in let statements:
The text was updated successfully, but these errors were encountered: