- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.
Description
The following suggestion is incorrect:
error[E0308]: mismatched types
   -->
    |
793 |         Condition::Function { function, description, expressions: exprs? }
    |                               ^^^^^^^^
    |                               |
    |                               expected enum `policy::MatchFunction`, found reference
    |                               help: consider dereferencing the borrow: `*function`
    |
    = note: expected type `policy::MatchFunction`
               found type `&policy::MatchFunction`
As the code is using the init shorthand syntax to create the Function variant, the suggestion should instead be:
error[E0308]: mismatched types
   -->
    |
793 |         Condition::Function { function, description, expressions: exprs? }
    |                               ^^^^^^^^
    |                               |
    |                               expected enum `policy::MatchFunction`, found reference
    |                               help: consider dereferencing the borrow: `function: *function`
    |
    = note: expected type `policy::MatchFunction`
               found type `&policy::MatchFunction`
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.