NLL: sort diagnostics by span by pnkfelix · Pull Request #52904 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation8 Commits5 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

pnkfelix

Sorting the output diagnostics by span is a long planned revision to the NLL diagnostics that we hope will yield a less surprising user experience in some case.

Once we got them buffered, it was trivial to implement. (The hard part is skimming the resulting changes to the diagnostics to make sure nothing broke... Note that I largely rubber-stamped the #[rustc_regions] output change.)

Fix #51167

@pnkfelix

…ource order

(and thus, hopefully, more closely match user expectation).

@pnkfelix

@pnkfelix

…ccmmodate diagnostic change.

@pnkfelix

@rust-highfive

r? @petrochenkov

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

petrochenkov

@@ -331,6 +331,10 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
}
if mbcx.errors_buffer.len() > 0 {
mbcx.errors_buffer.sort_by(|diag1, diag2
diag1.span.primary_span().cmp(&diag2.span.primary_span())
});

Choose a reason for hiding this comment

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

Nit: sort_by_key can be used here.

@petrochenkov

r=me after addressing the comment

@pnkfelix

@pnkfelix

@bors

📌 Commit 779792f has been approved by pnkfelix

@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

Jul 31, 2018

@pnkfelix

@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

Jul 31, 2018

@pnkfelix

@bors

📌 Commit 779792f has been approved by petrochenkov

@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

Jul 31, 2018

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request

Aug 1, 2018

@Mark-Simulacrum

…r=petrochenkov

NLL: sort diagnostics by span

Sorting the output diagnostics by span is a long planned revision to the NLL diagnostics that we hope will yield a less surprising user experience in some case.

Once we got them buffered, it was trivial to implement. (The hard part is skimming the resulting changes to the diagnostics to make sure nothing broke... Note that I largely rubber-stamped the #[rustc_regions] output change.)

Fix rust-lang#51167

bors added a commit that referenced this pull request

Aug 1, 2018

@bors

Rollup of 31 pull requests

Successful merges:

Failed merges:

r? @ghost

pietroalbini added a commit to pietroalbini/rust that referenced this pull request

Aug 1, 2018

@pietroalbini

…r=petrochenkov

NLL: sort diagnostics by span

Sorting the output diagnostics by span is a long planned revision to the NLL diagnostics that we hope will yield a less surprising user experience in some case.

Once we got them buffered, it was trivial to implement. (The hard part is skimming the resulting changes to the diagnostics to make sure nothing broke... Note that I largely rubber-stamped the #[rustc_regions] output change.)

Fix rust-lang#51167

bors added a commit that referenced this pull request

Aug 1, 2018

@bors

Rollup of 30 pull requests

Successful merges:

Failed merges:

r? @ghost

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.