3 #![warn(clippy::swap_ptr_to_ref)]
5 use core::ptr::addr_of_mut;
9 let y: *mut _ = &mut x;
10 let z: *mut _ = &mut x;
13 core::ptr::swap(y, z);
14 core::ptr::swap(y, &mut x);
15 core::ptr::swap(&mut x, y);
16 core::ptr::swap(addr_of_mut!(x), addr_of_mut!(x));
23 core::mem::swap(y, z);