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

Report number of delayed bugs properly with -Ztreat-err-as-bug #101471

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

compiler-errors
Copy link
Member

Report the number of delayed bugs that went into the -Ztreat-errr-as-bug=N being triggered, even if we don't count it in the err_count in regular diagnostic output.

Sometimes we have a session that creates a few diagnostics, perhaps: Error, Delay bug, Error, then Delay bug.
If I ran -Ztreat-err-as-bug=3, then I will now see "aborting after 2 errors and 1 delayed bugs" instead of just "after 2 errors" which is confusing since I passed 3.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 6, 2022
@rust-highfive
Copy link
Collaborator

r? @oli-obk

(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 Sep 6, 2022
self.flags.treat_err_as_bug.map(|c| c.get()).unwrap_or(0),
) {
(1, 1) => panic!("aborting due to `-Z treat-err-as-bug=1`"),
(0 | 1, _) => {}
Copy link
Member Author

Choose a reason for hiding this comment

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

This will literally never trigger -- because if the err count is 0 or 1, then for self.treat_err_as_bug() to have evaluated to true, then we must have -Ztreat-err-as-bug=1, which would have matched the previous arm.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 6, 2022

aaaa I literally hit that last week. Thank you!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 6, 2022

📌 Commit 38935bb has been approved by oli-obk

It is now in the queue for this repository.

@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 Sep 6, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 6, 2022
…llaumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#101357 (Include enum path in variant suggestion)
 - rust-lang#101434 (Update `SessionDiagnostic::into_diagnostic` to take `Handler` instead of `ParseSess`)
 - rust-lang#101445 (Suggest introducing an explicit lifetime if it does not exist)
 - rust-lang#101457 (Recover from using `;` as separator between fields)
 - rust-lang#101462 (Rustdoc-Json: Store Variant Fields as their own item.)
 - rust-lang#101471 (Report number of delayed bugs properly with `-Ztreat-err-as-bug`)
 - rust-lang#101473 (Add more size assertions for MIR types.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7d2e150 into rust-lang:master Sep 6, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 6, 2022
@compiler-errors compiler-errors deleted the delay-bug-are-count-too branch November 2, 2022 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Development

Successfully merging this pull request may close these issues.

5 participants