Skip to content
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

Get rid of redundancy in type errors #17823

Closed
kmcallister opened this issue Oct 6, 2014 · 14 comments
Closed

Get rid of redundancy in type errors #17823

kmcallister opened this issue Oct 6, 2014 · 14 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@kmcallister
Copy link
Contributor

error: mismatched types: expected `uint`, found `int` (expected uint, found int)  

I guess the parenthetical tells you about the outermost type constructors of the mismatch, e.g. "expected uint, found &-ptr". But in many cases it's redundant. We should get rid of the parenthetical in cases where it's useless, and then add some explanatory text about what it's trying to tell you.

@kmcallister kmcallister added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-diagnostics Area: Messages for errors, warnings, and lints labels Oct 6, 2014
@alexispurslane
Copy link
Contributor

So maybe it should check to see if the parenthetical is exactly the same, and not print it if it is?

@rclanan
Copy link
Contributor

rclanan commented Oct 19, 2014

I took a look at this and I am not sure what the fix would be. To save time for someone else the two locations that I identified are below:

@untitaker
Copy link
Contributor

I am interested in working on this.

if we wanted to remove them all together we would need to do a check here to change the string getting passed into format.

I suppose for this to happen the formatting of both error messages would have to be the same. Which version is preferred, with or without backticks around the types?

@anuragsoni
Copy link

Is anyone working on this? This behavior still happens with the 1.0 stable version.
test

@panyam
Copy link

panyam commented Sep 17, 2015

hey guys is anybody working on this? Id like to give this a go. First time contributing to rust so wanted something simple to start off with.

@alexispurslane
Copy link
Contributor

@panyam Go ahead! I don't think anybody has though about this in a while, although it might already be fixed, so you might need to make sure.

@alexispurslane
Copy link
Contributor

(I did mean to work on this, but it seems it slipped my mind)

@alexispurslane
Copy link
Contributor

@panyam Welcome to Rust, by the way! 🎊

@panyam
Copy link

panyam commented Sep 17, 2015

@ChristopherDumas - thanks for that mate... il give it a go.

@KalitaAlexey
Copy link
Contributor

@panyam I want to fix that. Do you mind?

@KalitaAlexey
Copy link
Contributor

I have the solution. Who can mentor me. I have some questions.

@jonas-schievink
Copy link
Contributor

This is fixed, right?

@KalitaAlexey
Copy link
Contributor

Yes.

@brson brson closed this as completed Jun 27, 2016
@brson
Copy link
Contributor

brson commented Jun 27, 2016

Thanks @KalitaAlexey <3

lnicola pushed a commit to lnicola/rust that referenced this issue Aug 13, 2024
fix: Fix unconfigured diagnostic being attached to the wrong file for modules

Fixes rust-lang/rust-analyzer#17817
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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

9 participants