Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
estebank opened this issue May 1, 2019 · 1 comment
Closed

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

estebank opened this issue May 1, 2019 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

estebank commented May 1, 2019

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.

@estebank estebank added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. labels May 1, 2019
@Centril
Copy link
Contributor

Centril commented May 1, 2019

I think a good diagnostic consists at minimum of:

  1. what went wrong,
  2. how you can fix it

but this move would get rid of 1. so I'm not a fan.

@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants