From 7e06b903649028268d1005cf5f40e2b6e24a6b83 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Thu, 22 Jul 2021 11:58:24 +0200 Subject: [PATCH] Fix SimpleRestartingEventManager broken generics --- libafl/src/events/simple.rs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/libafl/src/events/simple.rs b/libafl/src/events/simple.rs index 384aef0039..4c423aa546 100644 --- a/libafl/src/events/simple.rs +++ b/libafl/src/events/simple.rs @@ -214,7 +214,7 @@ where /// `restarter` will start a new process each time the child crashes or times out. #[cfg(feature = "std")] #[allow(clippy::default_trait_access)] -pub struct SimpleRestartingEventManager<'a, C, I, S, SP, ST> +pub struct SimpleRestartingEventManager<'a, C, I, S, SC, SP, ST> where C: Corpus, I: Input, @@ -227,11 +227,12 @@ where /// [`StateRestorer`] for restarts staterestorer: StateRestorer, /// Phantom data - _phantom: PhantomData<&'a (C, I, S)>, + _phantom: PhantomData<&'a (C, I, S, SC)>, } #[cfg(feature = "std")] -impl<'a, C, I, S, SP, ST> EventFirer for SimpleRestartingEventManager<'a, C, I, S, SP, ST> +impl<'a, C, I, S, SC, SP, ST> EventFirer + for SimpleRestartingEventManager<'a, C, I, S, SC, SP, ST> where C: Corpus, I: Input, @@ -245,7 +246,8 @@ where } #[cfg(feature = "std")] -impl<'a, C, I, S, SP, ST> EventRestarter for SimpleRestartingEventManager<'a, C, I, S, SP, ST> +impl<'a, C, I, S, SC, SP, ST> EventRestarter + for SimpleRestartingEventManager<'a, C, I, S, SC, SP, ST> where C: Corpus, I: Input, @@ -262,8 +264,8 @@ where } #[cfg(feature = "std")] -impl<'a, C, E, I, S, SP, ST, Z> EventProcessor - for SimpleRestartingEventManager<'a, C, I, S, SP, ST> +impl<'a, C, E, I, S, SC, SP, ST, Z> EventProcessor + for SimpleRestartingEventManager<'a, C, I, S, SC, SP, ST> where C: Corpus, I: Input, @@ -277,8 +279,8 @@ where } #[cfg(feature = "std")] -impl<'a, C, E, I, S, SP, ST, Z> EventManager - for SimpleRestartingEventManager<'a, C, I, S, SP, ST> +impl<'a, C, E, I, S, SC, SP, ST, Z> EventManager + for SimpleRestartingEventManager<'a, C, I, S, SC, SP, ST> where C: Corpus, I: Input, @@ -289,7 +291,8 @@ where } #[cfg(feature = "std")] -impl<'a, C, I, S, SP, ST> HasEventManagerId for SimpleRestartingEventManager<'a, C, I, S, SP, ST> +impl<'a, C, I, S, SC, SP, ST> HasEventManagerId + for SimpleRestartingEventManager<'a, C, I, S, SC, SP, ST> where C: Corpus, I: Input, @@ -304,11 +307,12 @@ where #[cfg(feature = "std")] #[allow(clippy::type_complexity, clippy::too_many_lines)] -impl<'a, C, I, S, SP, ST> SimpleRestartingEventManager<'a, C, I, S, SP, ST> +impl<'a, C, I, S, SC, SP, ST> SimpleRestartingEventManager<'a, C, I, S, SC, SP, ST> where C: Corpus, I: Input, - S: DeserializeOwned + Serialize + HasCorpus + HasSolutions, + S: DeserializeOwned + Serialize + HasCorpus + HasSolutions, + SC: Corpus, SP: ShMemProvider, ST: Stats, //TODO CE: CustomEvent, {