rust/compiler/rustc_middle/src
Matthias Krüger b95232dabb
Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxu
coverage: Restrict empty-span expansion to only cover `{` and `}`

Coverage instrumentation has some tricky code for converting a coverage-relevant `Span` into a set of start/end line/byte-column coordinates that will be embedded in the CGU's coverage metadata.

A big part of this complexity is special code for handling empty spans, which are expanded into non-empty spans (if possible) because LLVM's coverage reporter does not handle empty spans well.

This PR simplifies that code by restricting it to only apply in two specific situations: when the character after the empty span is `{`, or the character before the empty span is `}`.

(As an added benefit, this means that the expanded spans no longer extend awkwardly beyond the end of a physical line, which was common under the previous implementation.)

Along the way, this PR also removes some unhelpful code for dealing with function source code spread across multiple files. Functions currently can't have coverage spans in multiple files, and if that ever changes (e.g. to properly support expansion regions) then this code will need to be completely overhauled anyway.
2024-11-10 17:43:07 +01:00
..
dep_graph Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
hir compiler: Directly use rustc_abi in metadata and middle 2024-11-03 13:38:47 -08:00
hooks Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
infer Remove associated type based effects logic 2024-10-24 09:46:36 +00:00
middle Rollup merge of #132544 - dianne:unstable-library-feature-backticks, r=compiler-errors 2024-11-04 18:12:46 +01:00
mir Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxu 2024-11-10 17:43:07 +01:00
query Auto merge of #132173 - veluca93:abi_checks, r=RalfJung,compiler-errors 2024-11-10 02:52:25 +00:00
thir various fixes for naked_asm! implementation 2024-10-06 19:00:09 +02:00
traits Manually register some bounds for a better span 2024-11-08 04:56:08 +00:00
ty Rollup merge of #132799 - zachs18:str-primitive-symbol, r=compiler-errors 2024-11-09 19:16:46 +01:00
util ty::KContainer -> ty::AssocItemContainer::K 2024-11-04 04:45:52 +00:00
arena.rs compiler: Directly use rustc_abi in metadata and middle 2024-11-03 13:38:47 -08:00
error.rs Use bool in favor of Option<()> for diagnostics 2024-08-21 01:31:11 -04:00
lib.rs move strict provenance lints to new feature gate, remove old feature gates 2024-10-21 15:22:17 +01:00
lint.rs Remove module passes filtering 2024-10-19 16:20:51 +02:00
macros.rs Improve const traits diagnostics for new desugaring 2024-10-02 19:45:17 +08:00
metadata.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs compiler: Directly use rustc_abi in metadata and middle 2024-11-03 13:38:47 -08:00
values.rs compiler: Directly use rustc_abi in metadata and middle 2024-11-03 13:38:47 -08:00