about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-10-21 10:08:17 +0200
committerGitHub <noreply@github.com>2023-10-21 10:08:17 +0200
commite9df0b6b4038322f5c1428cce44ccee2e268be16 (patch)
tree4bb3a6eb0b1337726e7fb6397fc8fc1f6ef0ef5a /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parentb7035198e63a4898cdbee7aa29ea401742d7bd0a (diff)
parent319693a927f3cc7759586fcc3ae3fd740598c309 (diff)
downloadrust-e9df0b6b4038322f5c1428cce44ccee2e268be16.tar.gz
rust-e9df0b6b4038322f5c1428cce44ccee2e268be16.zip
Rollup merge of #116974 - Zalathar:signature-spans, r=oli-obk,cjgillot
coverage: Fix inconsistent handling of function signature spans

While doing some more cleanup of `spans`, I noticed a strange inconsistency in how function signatures are handled. Normally the function signature span is treated as though it were executable as part of the start of the function, but in some cases the signature span disappears entirely from coverage, for no obvious reason.

This is caused by the fact that spans created by `CoverageSpan::for_fn_sig` don't add the span to their `merged_spans` field (unlike normal statement/terminator spans). In cases where the span-processing code looks at those merged spans, it thinks the signature span is no longer visible and deletes it.

Adding the signature span to `merged_spans` resolves the inconsistency.

(Prior to #116409 this wouldn't have been possible, because there was no case in the old `CoverageStatement` enum representing a signature. Now that `merged_spans` is just a list of spans, that's no longer an obstacle.)
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions