@@ -422,8 +422,6 @@ pub(crate) unsafe fn get_initialized_ivar_ptr<T: DeclaredClass>(
422422mod tests {
423423 use alloc:: vec:: Vec ;
424424 use core:: cell:: Cell ;
425- use std:: println;
426- use std:: sync:: Mutex ;
427425
428426 use super :: * ;
429427 use crate :: rc:: { Allocated , PartialInit , RcTestObject , Retained , ThreadTestData } ;
@@ -459,7 +457,10 @@ mod tests {
459457 }
460458
461459 #[ test]
460+ #[ cfg( feature = "std" ) ]
462461 fn test_dealloc_and_dealloc_subclasses ( ) {
462+ use std:: sync:: Mutex ;
463+
463464 #[ derive( Debug , PartialEq ) ]
464465 enum Operation {
465466 DropIvar ,
@@ -674,7 +675,8 @@ mod tests {
674675 assert ! ( IvarZst :: class( ) . instance_variable( ivar_name) . is_none( ) ) ;
675676
676677 let obj = unsafe { init ( IvarZst :: alloc ( ) ) } ;
677- println ! ( "{:?}" , obj. ivars( ) . get( ) ) ;
678+ #[ cfg( feature = "std" ) ]
679+ std:: println!( "{:?}" , obj. ivars( ) . get( ) ) ;
678680 obj. ivars ( ) . set ( Ivar ) ;
679681 }
680682
@@ -838,7 +840,8 @@ mod tests {
838840
839841 // Accessing superclass ivars is valid
840842 // SAFETY: Cell not accessed while ivar is borrowed
841- println ! ( "{:?}" , unsafe { & * ( * * obj) . ivars( ) . as_ptr( ) } ) ;
843+ #[ cfg( feature = "std" ) ]
844+ std:: println!( "{:?}" , unsafe { & * ( * * obj) . ivars( ) . as_ptr( ) } ) ;
842845
843846 drop ( obj) ;
844847 expected. release += 1 ;
@@ -865,7 +868,8 @@ mod tests {
865868 ) ;
866869
867870 let obj = unsafe { init_only_superclasses ( InvalidAccess :: alloc ( ) ) } ;
868- println ! ( "{:?}" , obj. ivars( ) ) ;
871+ #[ cfg( feature = "std" ) ]
872+ std:: println!( "{:?}" , obj. ivars( ) ) ;
869873 }
870874
871875 #[ test]
0 commit comments