Function std::ptr::swap [] [src]

pub unsafe fn swap<T>(x: *mut T, y: *mut T)

Swaps the values at two mutable locations of the same type, without deinitialising either. They may overlap, unlike mem::swap`mem::swap` which is otherwise equivalent.

Safety

This is only unsafe because it accepts a raw pointer.