@@ -326,7 +326,6 @@ unsafe fn emit_frame_as_json(
326326#[ cfg( all( test, unix) ) ]
327327mod tests {
328328 use super :: * ;
329- use std:: ffi:: CString ;
330329 use std:: sync:: Mutex ;
331330
332331 // So we don't have race conditions with global static variable
@@ -350,10 +349,11 @@ mod tests {
350349 emit_frame ( & frame) ;
351350 }
352351
352+ #[ cfg( feature = "collector" ) ]
353353 unsafe extern "C" fn test_emit_stacktrace_string_callback (
354354 emit_stacktrace_string : unsafe extern "C" fn ( * const c_char ) ,
355355 ) {
356- let stacktrace_string = CString :: new ( "test_stacktrace_string" ) . unwrap ( ) ;
356+ let stacktrace_string = std :: ffi :: CString :: new ( "test_stacktrace_string" ) . unwrap ( ) ;
357357
358358 emit_stacktrace_string ( stacktrace_string. as_ptr ( ) ) ;
359359 }
@@ -383,6 +383,7 @@ mod tests {
383383
384384 #[ test]
385385 #[ cfg_attr( miri, ignore) ]
386+ #[ cfg( feature = "collector" ) ]
386387 fn test_frame_collection ( ) {
387388 let _guard = TEST_MUTEX . lock ( ) . unwrap ( ) ;
388389 ensure_callback_cleared ( ) ;
@@ -438,6 +439,7 @@ mod tests {
438439
439440 #[ test]
440441 #[ cfg_attr( miri, ignore) ]
442+ #[ cfg( feature = "collector" ) ]
441443 fn test_stacktrace_string_collection ( ) {
442444 let _guard = TEST_MUTEX . lock ( ) . unwrap ( ) ;
443445 ensure_callback_cleared ( ) ;
@@ -462,6 +464,7 @@ mod tests {
462464 }
463465
464466 #[ test]
467+ #[ cfg( feature = "collector" ) ]
465468 fn test_no_callback_registered ( ) {
466469 let _guard = TEST_MUTEX . lock ( ) . unwrap ( ) ;
467470 ensure_callback_cleared ( ) ;
@@ -484,6 +487,7 @@ mod tests {
484487
485488 #[ test]
486489 #[ cfg_attr( miri, ignore) ]
490+ #[ cfg( feature = "collector" ) ]
487491 fn test_direct_pipe_writing ( ) {
488492 let _guard = TEST_MUTEX . lock ( ) . unwrap ( ) ;
489493 ensure_callback_cleared ( ) ;
0 commit comments