Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Incorrect dereferencing suggestion when using init shorthand #52965

Closed

Description

@estebank

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`

Activity

  1. added
    A-diagnostics
    on Aug 1, 2018
  2. added
    C-bug
    A-suggestion-diagnostics
    on Mar 19, 2019
  3. added 2 commits that reference this issue on Mar 29, 2019
    22c267d
    41e64b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsA-suggestion-diagnosticsC-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions