@@ -336,12 +336,12 @@ where
336336 fn should_restart ( & mut self , state : & mut Self :: State ) -> Result < bool , Error > {
337337 // There's no restart safety in the content of the closure.
338338 // don't restart
339- StdRestartHelper :: no_retry ( state, & self . name )
339+ RetryCountRestartHelper :: no_retry ( state, & self . name )
340340 }
341341
342342 #[ inline]
343343 fn clear_progress ( & mut self , state : & mut Self :: State ) -> Result < ( ) , Error > {
344- StdRestartHelper :: clear_progress ( state, & self . name )
344+ RetryCountRestartHelper :: clear_progress ( state, & self . name )
345345 }
346346}
347347
@@ -481,26 +481,26 @@ where
481481 #[ inline]
482482 fn should_restart ( & mut self , state : & mut Self :: State ) -> Result < bool , Error > {
483483 // TODO: Proper restart handling - call post_exec at the right time, etc...
484- StdRestartHelper :: no_retry ( state, & self . name )
484+ RetryCountRestartHelper :: no_retry ( state, & self . name )
485485 }
486486
487487 #[ inline]
488488 fn clear_progress ( & mut self , state : & mut Self :: State ) -> Result < ( ) , Error > {
489- StdRestartHelper :: clear_progress ( state, & self . name )
489+ RetryCountRestartHelper :: clear_progress ( state, & self . name )
490490 }
491491}
492492
493493/// Progress which permits a fixed amount of resumes per round of fuzzing. If this amount is ever
494494/// exceeded, the input will no longer be executed by this stage.
495495#[ derive( Clone , Deserialize , Serialize , Debug ) ]
496- pub struct StdRestartHelper {
496+ pub struct RetryCountRestartHelper {
497497 tries_remaining : Option < usize > ,
498498 skipped : HashSet < CorpusId > ,
499499}
500500
501- impl_serdeany ! ( StdRestartHelper ) ;
501+ impl_serdeany ! ( RetryCountRestartHelper ) ;
502502
503- impl StdRestartHelper {
503+ impl RetryCountRestartHelper {
504504 /// Don't allow restart
505505 pub fn no_retry < S > ( state : & mut S , name : & str ) -> Result < bool , Error >
506506 where
@@ -518,7 +518,7 @@ impl StdRestartHelper {
518518 {
519519 let corpus_id = state. current_corpus_id ( ) ?. ok_or_else ( || {
520520 Error :: illegal_state (
521- "No current_corpus_id set in State, but called StdRestartHelper ::should_skip" ,
521+ "No current_corpus_id set in State, but called RetryCountRestartHelper ::should_skip" ,
522522 )
523523 } ) ?;
524524
@@ -689,7 +689,7 @@ pub mod test {
689689 use crate :: {
690690 corpus:: { Corpus , HasCurrentCorpusId , Testcase } ,
691691 inputs:: NopInput ,
692- stages:: { Stage , StdRestartHelper } ,
692+ stages:: { RetryCountRestartHelper , Stage } ,
693693 state:: { test:: test_std_state, HasCorpus , State , UsesState } ,
694694 HasMetadata ,
695695 } ;
@@ -776,7 +776,7 @@ pub mod test {
776776 // No concurrency per testcase
777777 #[ cfg( any( not( feature = "serdeany_autoreg" ) , miri) ) ]
778778 unsafe {
779- StdRestartHelper :: register ( ) ;
779+ RetryCountRestartHelper :: register ( ) ;
780780 }
781781
782782 struct StageWithOneTry ;
@@ -797,58 +797,58 @@ pub mod test {
797797
798798 for _ in 0 ..10 {
799799 // used normally, no retries means we never skip
800- assert ! ( StdRestartHelper :: should_restart(
800+ assert ! ( RetryCountRestartHelper :: should_restart(
801801 & mut state,
802802 stage. name( ) ,
803803 1
804804 ) ?) ;
805- StdRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
805+ RetryCountRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
806806 }
807807
808808 for _ in 0 ..10 {
809809 // used normally, only one retry means we never skip
810- assert ! ( StdRestartHelper :: should_restart(
810+ assert ! ( RetryCountRestartHelper :: should_restart(
811811 & mut state,
812812 stage. name( ) ,
813813 2
814814 ) ?) ;
815- assert ! ( StdRestartHelper :: should_restart(
815+ assert ! ( RetryCountRestartHelper :: should_restart(
816816 & mut state,
817817 stage. name( ) ,
818818 2
819819 ) ?) ;
820- StdRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
820+ RetryCountRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
821821 }
822822
823- assert ! ( StdRestartHelper :: should_restart(
823+ assert ! ( RetryCountRestartHelper :: should_restart(
824824 & mut state,
825825 stage. name( ) ,
826826 2
827827 ) ?) ;
828828 // task failed, let's resume
829829 // we still have one more try!
830- assert ! ( StdRestartHelper :: should_restart(
830+ assert ! ( RetryCountRestartHelper :: should_restart(
831831 & mut state,
832832 stage. name( ) ,
833833 2
834834 ) ?) ;
835835
836836 // task failed, let's resume
837837 // out of retries, so now we skip
838- assert ! ( !StdRestartHelper :: should_restart(
838+ assert ! ( !RetryCountRestartHelper :: should_restart(
839839 & mut state,
840840 stage. name( ) ,
841841 2
842842 ) ?) ;
843- StdRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
843+ RetryCountRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
844844
845845 // we previously exhausted this testcase's retries, so we skip
846- assert ! ( !StdRestartHelper :: should_restart(
846+ assert ! ( !RetryCountRestartHelper :: should_restart(
847847 & mut state,
848848 stage. name( ) ,
849849 2
850850 ) ?) ;
851- StdRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
851+ RetryCountRestartHelper :: clear_progress ( & mut state, stage. name ( ) ) ?;
852852
853853 Ok ( ( ) )
854854 }
0 commit comments