forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#118525 - Zalathar:skip-spans, r=cjgillot coverage: Skip spans that can't be un-expanded back to the function body When we extract coverage spans from MIR, we try to "un-expand" them back to spans that are inside the function's body span. In cases where that doesn't succeed, the current code just swaps in the entire body span instead. But that tends to result in coverage spans that are completely unrelated to the control flow of the affected code, so it's better to just discard those spans. --- Extracted from rust-lang#118305, since this is a general improvement that isn't specific to branch coverage. --- `@rustbot` label +A-code-coverage
- Loading branch information
Showing
7 changed files
with
30 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,5 @@ | |
LL| |#[inline(always)] | ||
LL| 0|fn error() { | ||
LL| 0| panic!("error"); | ||
LL| 0|} | ||
LL| |} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
Function name: unreachable::UNREACHABLE_CLOSURE::{closure#0} | ||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0f, 27, 00, 49] | ||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0f, 27, 00, 47] | ||
Number of files: 1 | ||
- file 0 => global file 1 | ||
Number of expressions: 0 | ||
Number of file 0 mappings: 1 | ||
- Code(Counter(0)) at (prev + 15, 39) to (start + 0, 73) | ||
- Code(Counter(0)) at (prev + 15, 39) to (start + 0, 71) | ||
|
||
Function name: unreachable::unreachable_function | ||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 11, 01, 02, 02] | ||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 11, 01, 01, 25] | ||
Number of files: 1 | ||
- file 0 => global file 1 | ||
Number of expressions: 0 | ||
Number of file 0 mappings: 1 | ||
- Code(Counter(0)) at (prev + 17, 1) to (start + 2, 2) | ||
- Code(Counter(0)) at (prev + 17, 1) to (start + 1, 37) | ||
|
||
Function name: unreachable::unreachable_intrinsic | ||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 16, 01, 02, 02] | ||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 16, 01, 01, 2c] | ||
Number of files: 1 | ||
- file 0 => global file 1 | ||
Number of expressions: 0 | ||
Number of file 0 mappings: 1 | ||
- Code(Counter(0)) at (prev + 22, 1) to (start + 2, 2) | ||
- Code(Counter(0)) at (prev + 22, 1) to (start + 1, 44) | ||
|
This file contains 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