-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields
--> clippy_lints/src/needless_borrow.rs:50:20
|
50 | if let ty::Ref(_) = cx.typeck_results().expr_ty(inner).kind() {
| ^^^^^^^^^^ expected 3 fields, found 1
trying to ignore the inner fields with ty::Ref(_)
does not work because it has 3 fields.
The message could suggest Ref(..)
if there are multiple fields and it thinks we don't want to bind any:
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields
--> clippy_lints/src/needless_borrow.rs:50:20
|
50 | if let ty::Ref(_) = cx.typeck_results().expr_ty(inner).kind() {
| ^^^^^^^^^^ expected 3 fields, found 1
= help: Use `ty::Ref(..)` to ignore any inner fields
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.