std: Add more docs to `std::mem::replace`.
auto merge of #13797 : lifthrasiir/rust/std-mem-replace-doc, r=alexcrichton

Inspired by @steveklabnik's [comment](http://www.reddit.com/r/rust/comments/240p9s/eli5_stdmemreplace/ch2gxw8), this PR adds the practical use cases to the documentation of `std::mem::replace`.

Caveat: We need a `compile-fail` equivalent for doctest. :p