File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ use intrinsics;
78
78
use cell:: UnsafeCell ;
79
79
80
80
use default:: Default ;
81
+ use fmt;
81
82
82
83
/// A boolean type which can be safely shared between threads.
83
84
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -1089,3 +1090,23 @@ pub fn fence(order: Ordering) {
1089
1090
}
1090
1091
}
1091
1092
}
1093
+
1094
+ macro_rules! impl_Debug {
1095
+ ( $( $t: ident) * ) => ( $(
1096
+ #[ stable( feature = "atomic_debug" , since = "1.3.0" ) ]
1097
+ impl fmt:: Debug for $t {
1098
+ fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
1099
+ f. debug_tuple( stringify!( $t) ) . field( & self . load( Ordering :: SeqCst ) ) . finish( )
1100
+ }
1101
+ }
1102
+ ) * ) ;
1103
+ }
1104
+
1105
+ impl_Debug ! { AtomicUsize AtomicIsize AtomicBool }
1106
+
1107
+ #[ stable( feature = "atomic_debug" , since = "1.3.0" ) ]
1108
+ impl < T > fmt:: Debug for AtomicPtr < T > {
1109
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1110
+ f. debug_tuple ( "AtomicPtr" ) . field ( & self . load ( Ordering :: SeqCst ) ) . finish ( )
1111
+ }
1112
+ }
You can’t perform that action at this time.
0 commit comments