We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af49c4d commit 2a1f97fCopy full SHA for 2a1f97f
library/core/src/cell.rs
@@ -434,6 +434,8 @@ impl<T> Cell<T> {
434
#[inline]
435
#[stable(feature = "move_cell", since = "1.17.0")]
436
pub fn swap(&self, other: &Self) {
437
+ // This function documents that it *will* panic, and intrinsics::is_nonoverlapping doesn't
438
+ // do the check in const, so trying to use it here would be inviting unnecessary fragility.
439
fn is_nonoverlapping<T>(src: *const T, dst: *const T) -> bool {
440
let src_usize = src.addr();
441
let dst_usize = dst.addr();
0 commit comments