rust/compiler/rustc_mir_transform
Matthias Krüger e9df0b6b40
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.)
2023-10-21 10:08:17 +02:00
..
src Rollup merge of #116974 - Zalathar:signature-spans, r=oli-obk,cjgillot 2023-10-21 10:08:17 +02:00
Cargo.toml Make unconditional_recursion warning detect recursive drops 2023-07-22 14:04:45 +02:00
messages.ftl Don't report any errors in lower_intrinsics. They should have been typecked before. 2023-09-06 09:38:15 +00:00