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

E0631 has duplicated diagnostics #64165

Closed
estebank opened this issue Sep 5, 2019 · 7 comments
Closed

E0631 has duplicated diagnostics #64165

estebank opened this issue Sep 5, 2019 · 7 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

estebank commented Sep 5, 2019

https://github.com/rust-lang/rust/blob/master/src/test/ui/anonymous-higher-ranked-lifetime.stderr has duplicated redundant diagnostics. We should come up with a deduplicating strategy to avoid them.

@estebank estebank added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 5, 2019
@gilescope
Copy link
Contributor

gilescope commented Sep 6, 2019

^ This. It really looks unprofessional when the errors are doubled up. And it's pretty unhelpful when your going through errors in the IDE and realise the error is pointing at a location you've already fixed.

Would rustc devs want a switch to see all the errors so they could check if some error was being raised far too many times? Or can we just keep things simple for now? - I see there is a dont_buffer_diagnostics flag. We can probably tie the deduplication to that.

@gilescope
Copy link
Contributor

I see all the code is in librustc_errors.

struct Diagnostic supports Hash, PartialEq...

@gilescope
Copy link
Contributor

In librustc, session has a one_time_diagnostics for deduplicating helpful notes so that we don't repeat them (#24690 and #44953).

@gilescope
Copy link
Contributor

Hang on, those diagnostics aren't pure duplicates. One is fn, the other is for.

@estebank
Copy link
Contributor Author

estebank commented Sep 9, 2019

They are caused by different Obligations, because closures introduce two. But that is the internal state of how the compiler reasons about closures, not something that needs (or can) to be communicated succinctly to the user in a way that makes sense. We have multiple places where we just keep a set of Spans or some other identifier and deduplicate specific errors where the underlying cause is different but the outwards behavior is the same.

@hbina
Copy link
Contributor

hbina commented Oct 3, 2019

Hello, I would like to work on this, but I am not entirely sure what to do here? Should I manually remove the duplicate tests from this "text" file?

@estebank
Copy link
Contributor Author

estebank commented Oct 4, 2019

@hbina thank you for wanting to help. Sadly this was already fixed in #64937 a couple of days back. Feel free to look at other tickets labeled E-easy and E-mentor for good first tickets to work on!

@estebank estebank closed this as completed Oct 4, 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. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-low Low priority 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

3 participants