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 @@ -3454,6 +3454,27 @@ impl<T: ObjectType> Default for WeakRef<T> {
3454
3454
unsafe impl < T : ObjectType + Sync + Sync > Sync for WeakRef < T > { }
3455
3455
unsafe impl < T : ObjectType + Send + Sync > Send for WeakRef < T > { }
3456
3456
3457
+ impl < T : ObjectType > PartialEq for WeakRef < T > {
3458
+ #[ inline]
3459
+ fn eq ( & self , other : & Self ) -> bool {
3460
+ unsafe { self . 0 . priv_ . p == other. 0 . priv_ . p }
3461
+ }
3462
+ }
3463
+
3464
+ impl < T : ObjectType > PartialEq < T > for WeakRef < T > {
3465
+ #[ inline]
3466
+ fn eq ( & self , other : & T ) -> bool {
3467
+ unsafe { self . 0 . priv_ . p == other. as_ptr ( ) as * mut std:: os:: raw:: c_void }
3468
+ }
3469
+ }
3470
+
3471
+ impl < T : ObjectType > PartialOrd for WeakRef < T > {
3472
+ #[ inline]
3473
+ fn partial_cmp ( & self , other : & Self ) -> Option < cmp:: Ordering > {
3474
+ unsafe { self . 0 . priv_ . p . partial_cmp ( & other. 0 . priv_ . p ) }
3475
+ }
3476
+ }
3477
+
3457
3478
// rustdoc-stripper-ignore-next
3458
3479
/// A weak reference to the object it was created for that can be sent to
3459
3480
/// different threads even for object types that don't implement `Send`.
You can’t perform that action at this time.
0 commit comments