diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-12-18 08:08:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-18 08:08:22 +0100 |
| commit | 418ae3e9a066c33a28c02b7cde1748e022f5a32a (patch) | |
| tree | f7bb47e32f24678b1dec25791beb535786ebfa63 /compiler/rustc_codegen_llvm/src/errors.rs | |
| parent | 8681e077b8afa99d60acf8f8470a012a3ce709a5 (diff) | |
| parent | e0de1439708d72a319ca334ef1d3237a7a4a6800 (diff) | |
| download | rust-418ae3e9a066c33a28c02b7cde1748e022f5a32a.tar.gz rust-418ae3e9a066c33a28c02b7cde1748e022f5a32a.zip | |
Rollup merge of #118852 - Zalathar:no-spans, r=cjgillot
coverage: Skip instrumenting a function if no spans were extracted from MIR The immediate symptoms of #118643 were fixed by #118666, but some users reported that their builds now encounter another coverage-related ICE: ``` error: internal compiler error: compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs:98:17: A used function should have had coverage mapping data but did not: (...) ``` I was able to reproduce at least one cause of this error: if no relevant spans could be extracted from a function, but the function contains `CoverageKind::SpanMarker` statements, then codegen still thinks the function is instrumented and complains about the fact that it has no coverage spans. This PR prevents that from happening in two ways: - If we didn't extract any relevant spans from MIR, skip instrumenting the entire function and don't create a `FunctionCoverateInfo` for it. - If coverage codegen sees a `CoverageKind::SpanMarker` statement, skip it early and avoid creating `func_coverage`. --- Fixes #118850.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
