Skip to content

Unused variables suggest _prefix for patterns with ref bindings when _ wildcard would suffice #59153

Closed
@estebank

Description

@estebank
error: unused variable: `e`
   --> src/librustc_resolve/error_reporting.rs:234:41
    |
234 |             if let PathSource::Expr(ref e) = source {
    |                                         ^ help: consider prefixing with an underscore: `_e`
    |
    = note: `-D unused-variables` implied by `-D warnings`

The correct suggestion is either to remove the ref e and supply _e or to change the code to ref e: _.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions