@@ -755,8 +755,6 @@ trait RcBoxPtr<T> {
755
755
fn inc_strong ( & self ) {
756
756
let strong = self . strong ( ) ;
757
757
// The reference count is always at least one unless we're about to drop the type
758
- // This allows the bulk of the destructor to be omitted in cases where we know that
759
- // the reference count must be > 0.
760
758
unsafe { assume ( strong > 0 ) ; }
761
759
self . inner ( ) . strong . set ( strong + 1 ) ;
762
760
}
@@ -765,8 +763,6 @@ trait RcBoxPtr<T> {
765
763
fn dec_strong ( & self ) {
766
764
let strong = self . strong ( ) ;
767
765
// The reference count is always at least one unless we're about to drop the type
768
- // This allows the bulk of the destructor to be omitted in cases where we know that
769
- // the reference count must be > 0
770
766
unsafe { assume ( strong > 0 ) ; }
771
767
self . inner ( ) . strong . set ( strong - 1 ) ;
772
768
}
@@ -786,9 +782,7 @@ impl<T> RcBoxPtr<T> for Rc<T> {
786
782
fn inner ( & self ) -> & RcBox < T > {
787
783
unsafe {
788
784
// Safe to assume this here, as if it weren't true, we'd be breaking
789
- // the contract anyway.
790
- // This allows the null check to be elided in the destructor if we
791
- // manipulated the reference count in the same function.
785
+ // the contract anyway
792
786
assume ( !self . _ptr . is_null ( ) ) ;
793
787
& ( * * self . _ptr )
794
788
}
@@ -801,8 +795,6 @@ impl<T> RcBoxPtr<T> for Weak<T> {
801
795
unsafe {
802
796
// Safe to assume this here, as if it weren't true, we'd be breaking
803
797
// the contract anyway
804
- // This allows the null check to be elided in the destructor if we
805
- // manipulated the reference count in the same function.
806
798
assume ( !self . _ptr . is_null ( ) ) ;
807
799
& ( * * self . _ptr )
808
800
}
0 commit comments