-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-lintArea: New lintsArea: New lintsC-an-interesting-projectCategory: Interesting projects, that usually are more involved design/code wise.Category: Interesting projects, that usually are more involved design/code wise.E-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-guidelinesLint: Related to the Rust API GuidelinesLint: Related to the Rust API GuidelinesT-middleType: Probably requires verifiying typesType: Probably requires verifiying types
Description
Ref: rust-lang/rfcs#2272
I would like an ambiguous_pattern
lint that either:
- requires the pattern to have
::
- requires the pattern to have
@
Those 2 requirements make it easy to avoid ambiguous patterns, for example:
match x {
C => {/*is this C a binding, or did you forget to import a constant?*/},
x => {/*is this x a lowercase constant or did you mean to make a binding?*/},
}
Instead, write it as:
match x {
m::C => {/*got constant C*/},
x @ _ => {/*got unknown*/},
}
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsC-an-interesting-projectCategory: Interesting projects, that usually are more involved design/code wise.Category: Interesting projects, that usually are more involved design/code wise.E-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-guidelinesLint: Related to the Rust API GuidelinesLint: Related to the Rust API GuidelinesT-middleType: Probably requires verifiying typesType: Probably requires verifiying types