File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1717
1818#![ allow( dead_code) ]
1919
20+ use core:: fmt;
2021use std:: cell:: SyncUnsafeCell ;
22+ use std:: fmt:: Debug ;
23+ use std:: fmt:: Formatter ;
2124use std:: hash:: Hash ;
2225use std:: hash:: Hasher ;
2326use std:: ops:: Deref ;
@@ -132,21 +135,21 @@ impl<T: ?Sized> Clone for ArcMut<T> {
132135 }
133136}
134137
135- impl < T > AsRef < T > for ArcMut < T > {
138+ impl < T : ? Sized > AsRef < T > for ArcMut < T > {
136139 #[ inline]
137140 fn as_ref ( & self ) -> & T {
138141 unsafe { & * self . inner . get ( ) }
139142 }
140143}
141144
142- impl < T > AsMut < T > for ArcMut < T > {
145+ impl < T : ? Sized > AsMut < T > for ArcMut < T > {
143146 #[ inline]
144147 fn as_mut ( & mut self ) -> & mut T {
145148 unsafe { & mut * self . inner . get ( ) }
146149 }
147150}
148151
149- impl < T > Deref for ArcMut < T > {
152+ impl < T : ? Sized > Deref for ArcMut < T > {
150153 type Target = T ;
151154
152155 #[ inline]
@@ -155,7 +158,7 @@ impl<T> Deref for ArcMut<T> {
155158 }
156159}
157160
158- impl < T > DerefMut for ArcMut < T > {
161+ impl < T : ? Sized > DerefMut for ArcMut < T > {
159162 #[ inline]
160163 fn deref_mut ( & mut self ) -> & mut Self :: Target {
161164 self . as_mut ( )
@@ -213,6 +216,12 @@ impl<T> DerefMut for SyncUnsafeCellWrapper<T> {
213216 }
214217}
215218
219+ impl < T : ?Sized + Debug > std:: fmt:: Debug for ArcMut < T > {
220+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
221+ fmt:: Debug :: fmt ( & * * self , f)
222+ }
223+ }
224+
216225#[ cfg( test) ]
217226mod arc_cell_wrapper_tests {
218227 use std:: sync:: Arc ;
You can’t perform that action at this time.
0 commit comments