Skip to content

Commit 95c7fde

Browse files
committed
Unbox and unwrap the contents of StatementKind::Coverage
The payload of coverage statements was historically a structure with several fields, so it was boxed to avoid bloating `StatementKind`. Now that the payload is a single relatively-small enum, we can replace `Box<Coverage>` with just `CoverageKind`. This patch also adds a size assertion for `StatementKind`, to avoid accidentally bloating it in the future.
1 parent a951158 commit 95c7fde

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coverageinfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use rustc_codegen_ssa::traits::CoverageInfoBuilderMethods;
2-
use rustc_middle::mir::Coverage;
2+
use rustc_middle::mir::coverage::CoverageKind;
33
use rustc_middle::ty::Instance;
44

55
use crate::builder::Builder;
66

77
impl<'a, 'gcc, 'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
8-
fn add_coverage(&mut self, _instance: Instance<'tcx>, _coverage: &Coverage) {
8+
fn add_coverage(&mut self, _instance: Instance<'tcx>, _kind: &CoverageKind) {
99
// TODO(antoyo)
1010
}
1111
}

0 commit comments

Comments
 (0)