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

Don't show the same help multiple times for object safety violations #117186

Closed
WaffleLapkin opened this issue Oct 25, 2023 · 3 comments · Fixed by #117200
Closed

Don't show the same help multiple times for object safety violations #117186

WaffleLapkin opened this issue Oct 25, 2023 · 3 comments · Fixed by #117200
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-trait-objects Area: trait objects, vtable layout D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@WaffleLapkin
Copy link
Member

#116401 made it so that we report all object safety violations at the same time. However, it also results in a redundant note:

https://github.com/rust-lang/rust/pull/116401/files#diff-ea89a7ba6273e575f66679f7c4a10297572773dc805cc27eb6398f7c12527ab8R16

We should not add the same note multiple times.

@WaffleLapkin WaffleLapkin 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 D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. A-trait-objects Area: trait objects, vtable layout labels Oct 25, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 25, 2023
@WaffleLapkin WaffleLapkin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 25, 2023
@matthiaskrgr
Copy link
Member

Can we add a debug assertion for duplicate identical help messages? (sorta like we do for "Span must not be empty and have no suggestion" or "Suggestion may not have overlapping parts" ?

@WaffleLapkin
Copy link
Member Author

@matthiaskrgr I guess we could, but I think there are multiple diagnostics that currently do this, so we'll have to fix them first.

@matthiaskrgr
Copy link
Member

Did not find tooo much...
inside tests:

for i in `git ls-files | grep \.stderr` ; do ; cat $i | uniq -cd ; done

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 A-trait-objects Area: trait objects, vtable layout D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants