about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/cell.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index e8590ab1158..0e719e169de 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -434,6 +434,8 @@ impl<T> Cell<T> {
     #[inline]
     #[stable(feature = "move_cell", since = "1.17.0")]
     pub fn swap(&self, other: &Self) {
+        // This function documents that it *will* panic, and intrinsics::is_nonoverlapping doesn't
+        // do the check in const, so trying to use it here would be inviting unnecessary fragility.
         fn is_nonoverlapping<T>(src: *const T, dst: *const T) -> bool {
             let src_usize = src.addr();
             let dst_usize = dst.addr();