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

Tweak some diagnostic spans #59084

Merged
merged 10 commits into from
Mar 24, 2019
Merged

Tweak some diagnostic spans #59084

merged 10 commits into from
Mar 24, 2019

Conversation

estebank
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 11, 2019
@estebank
Copy link
Contributor Author

r? @davidtwco

@rust-highfive rust-highfive assigned davidtwco and unassigned cramertj Mar 11, 2019
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor question, feel free to r=me.

@@ -5115,7 +5115,7 @@ impl<'a> Resolver<'a> {
// extra for the comma.
span.lo().0 - (prev_comma.as_bytes().len() as u32) - 1
));
err.span_suggestion(
err.tool_only_span_suggestion(
Copy link
Member

@davidtwco davidtwco Mar 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure about this change. I agree that it makes the error much cleaner, but without the help: ... message how would someone know that they can automatically have the problem fixed?

(as a slight aside, I think we should try use try cc groups like @rust-lang/wg-diagnostics when landing PRs like this or the one that introduced tool_only_span_suggestion - I had no idea this existed and it'd have been nice to follow along with it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tool_only_span_diagnostics was landed over the all hands because it was needed for a different change, so it's pretty recent.

Tools still will see the same json output, so vscode and rustfix would still be able to apply these. I guess I hadn't thought of the use case of someone running rustfix after running rustc iteratively. Should we mark these some other way? Cyan asterisk next to the error or something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is that users who know when they see help: ... that it is something that can be automatically applied won't know that for this error.

Something like a cyan asterisk would be ideal to draw attention to that (it might even raise awareness of rustfix being able to fix these things if everyone's error messages had a cyan asterisk suddenly appear). I wouldn't block this PR on that, so I'll r+ this and we can file a follow-up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #59103.

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 11, 2019

📌 Commit 63432949565d73020222ba99fb487f855b4b0565 has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 11, 2019
@estebank
Copy link
Contributor Author

@davidtwco added a small tweak to fix some less than stellar spans and marked the other duplicate import suggestion as tool only.

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Mar 11, 2019

📌 Commit a00fa50a3a47274416a3a1d404eb3a3a3afaba07 has been approved by davidtwco

@bors

This comment has been minimized.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 12, 2019
@estebank
Copy link
Contributor Author

@bors r=davidtwco rebased

@bors
Copy link
Contributor

bors commented Mar 12, 2019

📌 Commit f1ee5bb2c5029a452c7ae8f465f87e3278a640c9 has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 12, 2019
@bors
Copy link
Contributor

bors commented Mar 17, 2019

☔ The latest upstream changes (presumably #58899) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 17, 2019
@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor Author

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Mar 17, 2019

📌 Commit d1656f1 has been approved by davidtwco

@bors bors removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 17, 2019
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 17, 2019
sanxiyn added a commit to sanxiyn/rust that referenced this pull request Mar 18, 2019
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Mar 22, 2019
@bors
Copy link
Contributor

bors commented Mar 23, 2019

☔ The latest upstream changes (presumably #58929) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 23, 2019
@estebank
Copy link
Contributor Author

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Mar 23, 2019

📌 Commit 59f0f2e has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 23, 2019
@bors
Copy link
Contributor

bors commented Mar 23, 2019

⌛ Testing commit 59f0f2e with merge 93f5ba0...

bors added a commit that referenced this pull request Mar 23, 2019
@bors
Copy link
Contributor

bors commented Mar 24, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: davidtwco
Pushing 93f5ba0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 24, 2019
@bors bors merged commit 59f0f2e into rust-lang:master Mar 24, 2019
@estebank estebank deleted the diagnostic-spans branch November 9, 2023 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants