-
-
Notifications
You must be signed in to change notification settings - Fork 420
Description
I'm encountering a compiler error when calling the update_filter method from the HasInstrumentationFilter trait on an instance of QemuEdgeCoverageHelper. The error message suggests that the compiler can't infer the type for the S type parameter in the HasInstrumentationFilter trait implementation for QemuEdgeCoverageHelper.
Here's the relevant code:
hooks
.match_helper_mut::<QemuEdgeCoverageHelper>()
.unwrap()
.update_filter(
QemuInstrumentationAddressRangeFilter::AllowList(ranges.clone()),
&emu,
);
The HasInstrumentationFilter trait is defined like this:
pub trait HasInstrumentationFilter<F, S>
where
F: IsFilter,
{
fn filter(&self) -> &F;
fn filter_mut(&mut self) -> &mut F;
fn update_filter(&mut self, filter: F, emu: &Qemu) {
*self.filter_mut() = filter;
emu.flush_jit();
}
}
And QemuEdgeCoverageHelper is defined without any generic parameters.
The S type parameter is not used in the update_filter method or in the QemuEdgeCoverageHelper struct. I'm not sure why it's part of the HasInstrumentationFilter trait's definition or how to specify a type for S when calling update_filter.
Any help or guidance on how to resolve this issue would be greatly appreciated.