Deref & DerefMut move out of their self arguments

Pin in std::pin - Rust says: "By using this method(pub unsafe fn new_unchecked(pointer: Ptr) -> [Pin]), you are also making a promise about the Deref and DerefMut implementations of Ptr , if they exist. Most importantly, they must not move out of their self arguments: Pin::as_mut and Pin::as_ref will call DerefMut::deref_mut and Deref::deref on the pointer type Ptr and expect these methods to uphold the pinning invariants."

From my perspective, move out of their self arguments means method like fn consume(self), see below

struct ConsumingSelf {
    data: String,
}

impl ConsumingSelf {
    fn consume(self) -> String {
        self.data
    }
}

Thus I don't think 'deref' and 'derefMut' can actually "move out of their self arguments". I think it might refer to mem::swap operation, am I correct?

Yes, it refers to things such as mem::swap.