4

Strict provenance lint diagnostics improvements by niluxv · Pull Request #96112...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/96112
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Contributor

@niluxv niluxv commented 6 days ago

Use multipart_suggestion instead of span_suggestion and getting a snippet for the expression. Also don't suggest unnecessary parenthesis in lossy_provenance_casts.
cc @estebank
@rustbot label A-diagnostics

rustbot

added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label

6 days ago

Copy link

Collaborator

rust-highfive commented 6 days ago

r? @nagisa

(rust-highfive has picked a reviewer for you, use r? to override)

rustbot

added the A-diagnostics Area: Messages for errors, warnings, and lints label

6 days ago

rust-highfive

added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label

6 days ago

];

err.multipart_suggestion(msg, suggestions, Applicability::MaybeIncorrect);

} else {

err.span_suggestion(

Is there a reason why this doesn't use multipart_suggestion like in the branch above?

Copy link

Contributor

Author

@niluxv niluxv 6 days ago

Because it is not multipart? It is just a single part (single span, single suggestion String)...

Copy link

Contributor

Author

@niluxv niluxv 6 days ago

It does crate some inconsistency in the diagnostics depending on whether parenthesis are necessary, so maybe it would actually be better to use a multipart suggestion here too? But it just feels weird to do a multipart suggestion with only one part...

Copy link

Member

nagisa commented 6 days ago

Looks good to me! See the question in-line.

nagisa

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-review Status: Awaiting review from the assignee but also interested parties.

labels

6 days ago

Copy link

Member

nagisa commented 6 days ago

@bors r+ Ah well, we can make that specific suggestion use multipart later, if needed.

Copy link

Contributor

bors commented 6 days ago

pushpin Commit 1d63d6d has been approved by nagisa

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

6 days ago

bors

merged commit 99437b3 into

rust-lang:master 6 days ago

10 checks passed

rustbot

added this to the 1.62.0 milestone

6 days ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

nagisa

Assignees

nagisa

Labels

A-diagnostics Area: Messages for errors, warnings, and lints S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Milestone

1.62.0

Development

Successfully merging this pull request may close these issues.

None yet

5 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK