@@ -863,6 +863,9 @@ impl<T: ?Sized> !Sync for RefCell<T> {}
863
863
864
864
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
865
865
impl < T : Clone > Clone for RefCell < T > {
866
+ /// # Panics
867
+ ///
868
+ /// Panics if the value is currently mutably borrowed.
866
869
#[ inline]
867
870
fn clone ( & self ) -> RefCell < T > {
868
871
RefCell :: new ( self . borrow ( ) . clone ( ) )
@@ -880,6 +883,9 @@ impl<T:Default> Default for RefCell<T> {
880
883
881
884
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
882
885
impl < T : ?Sized + PartialEq > PartialEq for RefCell < T > {
886
+ /// # Panics
887
+ ///
888
+ /// Panics if the value is currently mutably borrowed.
883
889
#[ inline]
884
890
fn eq ( & self , other : & RefCell < T > ) -> bool {
885
891
* self . borrow ( ) == * other. borrow ( )
@@ -891,26 +897,41 @@ impl<T: ?Sized + Eq> Eq for RefCell<T> {}
891
897
892
898
#[ stable( feature = "cell_ord" , since = "1.10.0" ) ]
893
899
impl < T : ?Sized + PartialOrd > PartialOrd for RefCell < T > {
900
+ /// # Panics
901
+ ///
902
+ /// Panics if the value is currently mutably borrowed.
894
903
#[ inline]
895
904
fn partial_cmp ( & self , other : & RefCell < T > ) -> Option < Ordering > {
896
905
self . borrow ( ) . partial_cmp ( & * other. borrow ( ) )
897
906
}
898
907
908
+ /// # Panics
909
+ ///
910
+ /// Panics if the value is currently mutably borrowed.
899
911
#[ inline]
900
912
fn lt ( & self , other : & RefCell < T > ) -> bool {
901
913
* self . borrow ( ) < * other. borrow ( )
902
914
}
903
915
916
+ /// # Panics
917
+ ///
918
+ /// Panics if the value is currently mutably borrowed.
904
919
#[ inline]
905
920
fn le ( & self , other : & RefCell < T > ) -> bool {
906
921
* self . borrow ( ) <= * other. borrow ( )
907
922
}
908
923
924
+ /// # Panics
925
+ ///
926
+ /// Panics if the value is currently mutably borrowed.
909
927
#[ inline]
910
928
fn gt ( & self , other : & RefCell < T > ) -> bool {
911
929
* self . borrow ( ) > * other. borrow ( )
912
930
}
913
931
932
+ /// # Panics
933
+ ///
934
+ /// Panics if the value is currently mutably borrowed.
914
935
#[ inline]
915
936
fn ge ( & self , other : & RefCell < T > ) -> bool {
916
937
* self . borrow ( ) >= * other. borrow ( )
@@ -919,6 +940,9 @@ impl<T: ?Sized + PartialOrd> PartialOrd for RefCell<T> {
919
940
920
941
#[ stable( feature = "cell_ord" , since = "1.10.0" ) ]
921
942
impl < T : ?Sized + Ord > Ord for RefCell < T > {
943
+ /// # Panics
944
+ ///
945
+ /// Panics if the value is currently mutably borrowed.
922
946
#[ inline]
923
947
fn cmp ( & self , other : & RefCell < T > ) -> Ordering {
924
948
self . borrow ( ) . cmp ( & * other. borrow ( ) )
0 commit comments