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.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use super::BackendTypes;
|
||||
use rustc_middle::mir::Coverage;
|
||||
use rustc_middle::mir::coverage::CoverageKind;
|
||||
use rustc_middle::ty::Instance;
|
||||
|
||||
pub trait CoverageInfoBuilderMethods<'tcx>: BackendTypes {
|
||||
@@ -7,5 +7,5 @@ pub trait CoverageInfoBuilderMethods<'tcx>: BackendTypes {
|
||||
///
|
||||
/// This can potentially be a no-op in backends that don't support
|
||||
/// coverage instrumentation.
|
||||
fn add_coverage(&mut self, instance: Instance<'tcx>, coverage: &Coverage);
|
||||
fn add_coverage(&mut self, instance: Instance<'tcx>, kind: &CoverageKind);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user