Skip to content

Hide found a, expected b label when suggestion is provided #60430

Closed
@estebank

Description

@estebank

I'm ambivalent about this, but @oli-obk pointed this case out in #60159 (comment)

When providing a suggestion for a type error that would fix the problem, we have the following output:

error[E0308]: mismatched types
  --> $DIR/type-mismatch-struct-field-shorthand-2.rs:5:19
   |
LL |     let _ = RGB { r, g, c };
   |                   ^
   |                   |
   |                   expected f64, found f32
   |                   help: you can convert an `f32` to `f64`: `r: r.into()`

we could change it to

error[E0308]: mismatched types
  --> $DIR/type-mismatch-struct-field-shorthand-2.rs:5:19
   |
LL |     let _ = RGB { r, g, c };
   |                   ^ help: you can convert an `f32` to `f64`: `r: r.into()`

but I'm not sure wether that is a good move.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.S-waiting-on-bikeshedStatus: Awaiting a decision on trivial things.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