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

coverage: Replace impossible coverage::Error with assertions #117421

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Oct 31, 2023

Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by #115962, so we can now simplify these methods by making them panic immediately when they detect a bug.

@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2023

r? @petrochenkov

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 31, 2023
@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Oct 31, 2023
Comment on lines -171 to -173
.unwrap_or_else(|e| {
bug!("Error processing: {:?}: {:?}", self.mir_body.source.def_id(), e.message)
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where all the errors would have been converted into panics.

Comment on lines -656 to -658
coverage_counters
.make_bcb_counters(&mut basic_coverage_blocks, bcb_has_coverage_spans)
.expect("should be Ok");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this code is changing anyway, I've taken the opportunity to also get rid of some unnecessary &mut references to the BCB graph that were left over from #114354.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 31, 2023

@bors r=oli-obk,Swatinem

@bors
Copy link
Contributor

bors commented Oct 31, 2023

📌 Commit e50df22 has been approved by oli-obk,Swatinem

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 Oct 31, 2023
These checks should be cheap, so there's little reason for them to be
debug-only.
Historically, these errors existed so that the coverage debug code could dump
additional information before reporting a compiler bug. That debug code was
removed by rust-lang#115962, so we can now simplify these methods by making them panic
when they detect a bug.
@Zalathar Zalathar force-pushed the error branch 2 times, most recently from 75a1109 to 6d956a2 Compare October 31, 2023 11:20
@oli-obk
Copy link
Contributor

oli-obk commented Oct 31, 2023

@bors r=oli-obk,Swatinem

@bors
Copy link
Contributor

bors commented Oct 31, 2023

📌 Commit 6d956a2 has been approved by oli-obk,Swatinem

It is now in the queue for this repository.

@Zalathar
Copy link
Contributor Author

Zalathar commented Oct 31, 2023

Ah whoops, I hadn't noticed that this had been approved while I was making a small tweak to a variable name (diff).

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2023
coverage: Replace impossible `coverage::Error` with assertions

Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic immediately when they detect a bug.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#116267 (Some codegen cleanups around SIMD checks)
 - rust-lang#116712 (When encountering unclosed delimiters during lexing, check for diff markers)
 - rust-lang#117416 (Also consider TAIT to be uncomputable if the MIR body is tainted)
 - rust-lang#117421 (coverage: Replace impossible `coverage::Error` with assertions)
 - rust-lang#117438 (Do not ICE on constant evaluation failure in GVN.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 793776f into rust-lang:master Oct 31, 2023
11 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Oct 31, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2023
Rollup merge of rust-lang#117421 - Zalathar:error, r=oli-obk,Swatinem

coverage: Replace impossible `coverage::Error` with assertions

Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic immediately when they detect a bug.
@Zalathar Zalathar deleted the error branch October 31, 2023 21:58
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Nov 1, 2023
78: Automated pull from upstream `master` r=tshepang a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#113970
* rust-lang/rust#117459
  * rust-lang/rust#117451
  * rust-lang/rust#117439
  * rust-lang/rust#117417
  * rust-lang/rust#117388
  * rust-lang/rust#113241
* rust-lang/rust#117462
* rust-lang/rust#117450
* rust-lang/rust#117407
* rust-lang/rust#117444
  * rust-lang/rust#117438
  * rust-lang/rust#117421
  * rust-lang/rust#117416
  * rust-lang/rust#116712
  * rust-lang/rust#116267
* rust-lang/rust#117377
* rust-lang/rust#117419



Co-authored-by: Alexis (Poliorcetics) Bourget <ab_github@poliorcetiq.eu>
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Michael Goulet <michael@errs.io>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: Camille GILLOT <gillot.camille@gmail.com>
Co-authored-by: lcnr <rust@lcnr.de>
Co-authored-by: Zalathar <Zalathar@users.noreply.github.com>
Co-authored-by: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) 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.

7 participants