diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-03-23 19:13:52 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-03-23 22:05:11 +1100 |
| commit | 95c7fde6b116daf2bd9078216f560b65edc87737 (patch) | |
| tree | 4a9107c620262b9d108e494c4f8983b269035322 | |
| parent | a9511585655c5ab232007354914252e4fdfc719e (diff) | |
| download | rust-95c7fde6b116daf2bd9078216f560b65edc87737.tar.gz rust-95c7fde6b116daf2bd9078216f560b65edc87737.zip | |
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.
| -rw-r--r-- | src/coverageinfo.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coverageinfo.rs b/src/coverageinfo.rs index 849e9886ef3..4e44f78f23c 100644 --- a/src/coverageinfo.rs +++ b/src/coverageinfo.rs @@ -1,11 +1,11 @@ use rustc_codegen_ssa::traits::CoverageInfoBuilderMethods; -use rustc_middle::mir::Coverage; +use rustc_middle::mir::coverage::CoverageKind; use rustc_middle::ty::Instance; use crate::builder::Builder; impl<'a, 'gcc, 'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> { - fn add_coverage(&mut self, _instance: Instance<'tcx>, _coverage: &Coverage) { + fn add_coverage(&mut self, _instance: Instance<'tcx>, _kind: &CoverageKind) { // TODO(antoyo) } } |
