]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #98868 - tmiasko:unreachable-coverage, r=wesleywiser
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Fri, 22 Jul 2022 06:23:40 +0000 (11:53 +0530)
committerGitHub <noreply@github.com>
Fri, 22 Jul 2022 06:23:40 +0000 (11:53 +0530)
commit6e3dd69e36d42318f1c930de57858109bfc1730c
treec881dc63e1b365cc1e0851a7150165599a9f4edf
parentad31d5c6a5551c88e98dd35c70a7af18445dadd8
parent947314125370164f52feb221ef2f1aac0e420309
Rollup merge of #98868 - tmiasko:unreachable-coverage, r=wesleywiser

Fix unreachable coverage generation for inlined functions

To generate a function coverage we need at least one coverage counter,
so a coverage from unreachable blocks is retained only when some live
counters remain.

The previous implementation incorrectly retained unreachable coverage,
because it didn't account for the fact that those live counters can
belong to another function due to inlining.

Fixes #98833.
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_monomorphize/src/partitioning/mod.rs