Skip to content

[...] patterns are confusingly called "vector patterns" in error messages #17765

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

Closed
huonw opened this issue Oct 4, 2014 · 0 comments
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@huonw
Copy link
Member

huonw commented Oct 4, 2014

fn main() {
    let [] = vec![];
}
<anon>:3:9: 3:11 error: mismatched types: expected `collections::vec::Vec<<generic #3>>`, found a vector pattern
<anon>:3     let [] = vec![];
                 ^~
error: aborting due to previous error

This is very confusing because they only work with slices and arrays, and it's not rare to try to match on a Vec, drawing a false link between the pattern and the Vec type.

They should be called "array patterns" or "slice patterns". (Tagging as easy because it should be a matter of git grep 'vector pattern' and fixing all the locations: it could probably be done via sed!)

@huonw huonw added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-diagnostics Area: Messages for errors, warnings, and lints labels Oct 4, 2014
@huonw huonw changed the title [...] patterns are called "vector patterns" in error messages [...] patterns are confusingly called "vector patterns" in error messages Oct 4, 2014
bors added a commit that referenced this issue Oct 5, 2014
@bors bors closed this as completed in 88baca7 Oct 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant