@@ -24,7 +24,7 @@ use windows::Win32::System::Threading::{CRITICAL_SECTION, PTP_TIMER};
24
24
#[ cfg( feature = "std" ) ]
25
25
use crate :: executors:: hooks:: timer:: TimerStruct ;
26
26
use crate :: {
27
- Error , HasObjective ,
27
+ Error , HasFeedback , HasObjective ,
28
28
events:: { EventFirer , EventRestarter } ,
29
29
executors:: { Executor , HasObservers , hooks:: ExecutorHook , inprocess:: HasInProcessHooks } ,
30
30
feedbacks:: Feedback ,
@@ -202,7 +202,7 @@ impl<I, S> ExecutorHook<I, S> for InProcessHooks<I, S> {
202
202
// Imagine there are two executors, you have to set the correct crash handlers for each of the executor.
203
203
unsafe {
204
204
let data = & raw mut GLOBAL_STATE ;
205
- assert ! ( ( * data) . crash_handler == null ( ) ) ;
205
+ assert ! ( ( * data) . crash_handler. is_null ( ) ) ;
206
206
// usually timeout handler and crash handler is set together
207
207
// so no check for timeout handler is null or not
208
208
( * data) . crash_handler = self . crash_handler ;
@@ -232,14 +232,15 @@ impl<I, S> InProcessHooks<I, S> {
232
232
/// Create new [`InProcessHooks`].
233
233
#[ cfg( unix) ]
234
234
#[ allow( unused_variables) ] // for `exec_tmout` without `std`
235
- pub fn new < E , EM , OF , Z > ( exec_tmout : Duration ) -> Result < Self , Error >
235
+ pub fn new < E , EM , F , OF , Z > ( exec_tmout : Duration ) -> Result < Self , Error >
236
236
where
237
237
E : Executor < EM , I , S , Z > + HasObservers + HasInProcessHooks < I , S > ,
238
238
E :: Observers : ObserversTuple < I , S > ,
239
239
EM : EventFirer < I , S > + EventRestarter < S > ,
240
+ F : Feedback < EM , I , E :: Observers , S > ,
240
241
OF : Feedback < EM , I , E :: Observers , S > ,
241
242
S : HasExecutions + HasSolutions < I > + HasCurrentTestcase < I > ,
242
- Z : HasObjective < Objective = OF > ,
243
+ Z : HasObjective < Objective = OF > + HasFeedback < Feedback = F > ,
243
244
I : Input + Clone ,
244
245
{
245
246
// # Safety
@@ -249,7 +250,7 @@ impl<I, S> InProcessHooks<I, S> {
249
250
#[ cfg( all( not( miri) , unix, feature = "std" ) ) ]
250
251
let data = unsafe { & raw mut GLOBAL_STATE } ;
251
252
#[ cfg( feature = "std" ) ]
252
- unix_signal_handler:: setup_panic_hook :: < E , EM , I , OF , S , Z > ( ) ;
253
+ unix_signal_handler:: setup_panic_hook :: < E , EM , F , I , OF , S , Z > ( ) ;
253
254
// # Safety
254
255
// Setting up the signal handlers with a pointer to the `GLOBAL_STATE` which should not be NULL at this point.
255
256
// We are the sole users of `GLOBAL_STATE` right now, and only dereference it in case of Segfault/Panic.
@@ -262,10 +263,10 @@ impl<I, S> InProcessHooks<I, S> {
262
263
compiler_fence ( Ordering :: SeqCst ) ;
263
264
Ok ( Self {
264
265
#[ cfg( feature = "std" ) ]
265
- crash_handler : unix_signal_handler:: inproc_crash_handler :: < E , EM , I , OF , S , Z >
266
+ crash_handler : unix_signal_handler:: inproc_crash_handler :: < E , EM , F , I , OF , S , Z >
266
267
as * const c_void ,
267
268
#[ cfg( feature = "std" ) ]
268
- timeout_handler : unix_signal_handler:: inproc_timeout_handler :: < E , EM , I , OF , S , Z >
269
+ timeout_handler : unix_signal_handler:: inproc_timeout_handler :: < E , EM , F , I , OF , S , Z >
269
270
as * const _ ,
270
271
#[ cfg( feature = "std" ) ]
271
272
timer : TimerStruct :: new ( exec_tmout) ,
@@ -276,15 +277,16 @@ impl<I, S> InProcessHooks<I, S> {
276
277
/// Create new [`InProcessHooks`].
277
278
#[ cfg( windows) ]
278
279
#[ allow( unused_variables) ] // for `exec_tmout` without `std`
279
- pub fn new < E , EM , OF , Z > ( exec_tmout : Duration ) -> Result < Self , Error >
280
+ pub fn new < E , EM , F , OF , Z > ( exec_tmout : Duration ) -> Result < Self , Error >
280
281
where
281
282
E : Executor < EM , I , S , Z > + HasObservers + HasInProcessHooks < I , S > ,
282
283
E :: Observers : ObserversTuple < I , S > ,
283
284
EM : EventFirer < I , S > + EventRestarter < S > ,
284
285
I : Input + Clone ,
286
+ F : Feedback < EM , I , E :: Observers , S > ,
285
287
OF : Feedback < EM , I , E :: Observers , S > ,
286
288
S : HasExecutions + HasSolutions < I > + HasCurrentTestcase < I > ,
287
- Z : HasObjective < Objective = OF > ,
289
+ Z : HasObjective < Objective = OF > + HasFeedback < Feedback = F > ,
288
290
{
289
291
let ret;
290
292
#[ cfg( feature = "std" ) ]
@@ -293,6 +295,7 @@ impl<I, S> InProcessHooks<I, S> {
293
295
crate :: executors:: hooks:: windows:: windows_exception_handler:: setup_panic_hook :: <
294
296
E ,
295
297
EM ,
298
+ F ,
296
299
I ,
297
300
OF ,
298
301
S ,
@@ -304,6 +307,7 @@ impl<I, S> InProcessHooks<I, S> {
304
307
crate :: executors:: hooks:: windows:: windows_exception_handler:: inproc_crash_handler :: <
305
308
E ,
306
309
EM ,
310
+ F ,
307
311
I ,
308
312
OF ,
309
313
S ,
@@ -313,6 +317,7 @@ impl<I, S> InProcessHooks<I, S> {
313
317
crate :: executors:: hooks:: windows:: windows_exception_handler:: inproc_timeout_handler :: <
314
318
E ,
315
319
EM ,
320
+ F ,
316
321
I ,
317
322
OF ,
318
323
S ,
@@ -339,13 +344,14 @@ impl<I, S> InProcessHooks<I, S> {
339
344
/// Create a new [`InProcessHooks`]
340
345
#[ cfg( all( not( unix) , not( windows) ) ) ]
341
346
#[ expect( unused_variables) ]
342
- pub fn new < E , EM , OF , Z > ( exec_tmout : Duration ) -> Result < Self , Error >
347
+ pub fn new < E , EM , F , OF , Z > ( exec_tmout : Duration ) -> Result < Self , Error >
343
348
where
344
349
E : Executor < EM , I , S , Z > + HasObservers + HasInProcessHooks < I , S > ,
345
350
EM : EventFirer < I , S > + EventRestarter < S > ,
351
+ F : Feedback < EM , I , E :: Observers , S > ,
346
352
OF : Feedback < EM , I , E :: Observers , S > ,
347
353
S : HasExecutions + HasSolutions < I > ,
348
- Z : HasObjective < Objective = OF > ,
354
+ Z : HasObjective < Objective = OF > + HasFeedback < Feedback = F > ,
349
355
{
350
356
#[ cfg_attr( miri, allow( unused_variables) ) ]
351
357
let ret = Self {
@@ -472,17 +478,18 @@ impl InProcessExecutorHandlerData {
472
478
///
473
479
/// Should only be called to signal a crash in the target
474
480
#[ cfg( all( unix, feature = "std" ) ) ]
475
- pub unsafe fn maybe_report_crash < E , EM , I , OF , S , Z > (
481
+ pub unsafe fn maybe_report_crash < E , EM , F , I , OF , S , Z > (
476
482
& mut self ,
477
483
bsod_info : Option < BsodInfo > ,
478
484
) -> bool
479
485
where
480
486
E : Executor < EM , I , S , Z > + HasObservers ,
481
487
E :: Observers : ObserversTuple < I , S > ,
482
488
EM : EventFirer < I , S > + EventRestarter < S > ,
489
+ F : Feedback < EM , I , E :: Observers , S > ,
483
490
OF : Feedback < EM , I , E :: Observers , S > ,
484
491
S : HasExecutions + HasSolutions < I > + HasCorpus < I > + HasCurrentTestcase < I > ,
485
- Z : HasObjective < Objective = OF > ,
492
+ Z : HasObjective < Objective = OF > + HasFeedback < Feedback = F > ,
486
493
I : Input + Clone ,
487
494
{
488
495
unsafe {
@@ -510,7 +517,7 @@ impl InProcessExecutorHandlerData {
510
517
}
511
518
}
512
519
513
- run_observers_and_save_state :: < E , EM , I , OF , S , Z > (
520
+ run_observers_and_save_state :: < E , EM , F , I , OF , S , Z > (
514
521
executor,
515
522
state,
516
523
input,
0 commit comments