@@ -807,7 +807,8 @@ impl<T> RefCell<T> {
807
807
///
808
808
/// # Panics
809
809
///
810
- /// Panics if the value in either `RefCell` is currently borrowed.
810
+ /// Panics if the value in either `RefCell` is currently borrowed, or
811
+ /// if `self` and `other` point to the same `RefCell`.
811
812
///
812
813
/// # Examples
813
814
///
@@ -1193,7 +1194,7 @@ impl<T: Default> Default for RefCell<T> {
1193
1194
impl < T : ?Sized + PartialEq > PartialEq for RefCell < T > {
1194
1195
/// # Panics
1195
1196
///
1196
- /// Panics if the value in either `RefCell` is currently borrowed.
1197
+ /// Panics if the value in either `RefCell` is currently mutably borrowed.
1197
1198
#[ inline]
1198
1199
fn eq ( & self , other : & RefCell < T > ) -> bool {
1199
1200
* self . borrow ( ) == * other. borrow ( )
@@ -1207,39 +1208,39 @@ impl<T: ?Sized + Eq> Eq for RefCell<T> {}
1207
1208
impl < T : ?Sized + PartialOrd > PartialOrd for RefCell < T > {
1208
1209
/// # Panics
1209
1210
///
1210
- /// Panics if the value in either `RefCell` is currently borrowed.
1211
+ /// Panics if the value in either `RefCell` is currently mutably borrowed.
1211
1212
#[ inline]
1212
1213
fn partial_cmp ( & self , other : & RefCell < T > ) -> Option < Ordering > {
1213
1214
self . borrow ( ) . partial_cmp ( & * other. borrow ( ) )
1214
1215
}
1215
1216
1216
1217
/// # Panics
1217
1218
///
1218
- /// Panics if the value in either `RefCell` is currently borrowed.
1219
+ /// Panics if the value in either `RefCell` is currently mutably borrowed.
1219
1220
#[ inline]
1220
1221
fn lt ( & self , other : & RefCell < T > ) -> bool {
1221
1222
* self . borrow ( ) < * other. borrow ( )
1222
1223
}
1223
1224
1224
1225
/// # Panics
1225
1226
///
1226
- /// Panics if the value in either `RefCell` is currently borrowed.
1227
+ /// Panics if the value in either `RefCell` is currently mutably borrowed.
1227
1228
#[ inline]
1228
1229
fn le ( & self , other : & RefCell < T > ) -> bool {
1229
1230
* self . borrow ( ) <= * other. borrow ( )
1230
1231
}
1231
1232
1232
1233
/// # Panics
1233
1234
///
1234
- /// Panics if the value in either `RefCell` is currently borrowed.
1235
+ /// Panics if the value in either `RefCell` is currently mutably borrowed.
1235
1236
#[ inline]
1236
1237
fn gt ( & self , other : & RefCell < T > ) -> bool {
1237
1238
* self . borrow ( ) > * other. borrow ( )
1238
1239
}
1239
1240
1240
1241
/// # Panics
1241
1242
///
1242
- /// Panics if the value in either `RefCell` is currently borrowed.
1243
+ /// Panics if the value in either `RefCell` is currently mutably borrowed.
1243
1244
#[ inline]
1244
1245
fn ge ( & self , other : & RefCell < T > ) -> bool {
1245
1246
* self . borrow ( ) >= * other. borrow ( )
@@ -1250,7 +1251,7 @@ impl<T: ?Sized + PartialOrd> PartialOrd for RefCell<T> {
1250
1251
impl < T : ?Sized + Ord > Ord for RefCell < T > {
1251
1252
/// # Panics
1252
1253
///
1253
- /// Panics if the value in either `RefCell` is currently borrowed.
1254
+ /// Panics if the value in either `RefCell` is currently mutably borrowed.
1254
1255
#[ inline]
1255
1256
fn cmp ( & self , other : & RefCell < T > ) -> Ordering {
1256
1257
self . borrow ( ) . cmp ( & * other. borrow ( ) )
0 commit comments