File tree 1 file changed +13
-1
lines changed 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ pub fn gc_init() {
38
38
///
39
39
/// `Gc<T>` automatically dereferences to `T` (via the `Deref` trait), so
40
40
/// you can call `T`'s methods on a value of type `Gc<T>`.
41
- #[ derive( PartialEq , Eq , Debug ) ]
41
+ #[ derive( PartialEq , Eq ) ]
42
42
pub struct Gc < T : ?Sized + Send + Sync > {
43
43
ptr : NonNull < GcBox < T > > ,
44
44
_phantom : PhantomData < T > ,
@@ -176,6 +176,18 @@ impl<T: ?Sized + fmt::Display + Send + Sync> fmt::Display for Gc<T> {
176
176
}
177
177
}
178
178
179
+ impl < T : ?Sized + fmt:: Debug + Send + Sync > fmt:: Debug for Gc < T > {
180
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
181
+ fmt:: Debug :: fmt ( & * * self , f)
182
+ }
183
+ }
184
+
185
+ impl < T : ?Sized + Send + Sync > fmt:: Pointer for Gc < T > {
186
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
187
+ fmt:: Pointer :: fmt ( & ( & * * self as * const T ) , f)
188
+ }
189
+ }
190
+
179
191
/// A `GcBox` is a 0-cost wrapper which allows a single `Drop` implementation
180
192
/// while also permitting multiple, copyable `Gc` references. The `drop` method
181
193
/// on `GcBox` acts as a guard, preventing the destructors on its contents from
You can’t perform that action at this time.
0 commit comments