diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-03-19 15:16:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-19 15:16:53 +0100 |
| commit | 61ff887919ba03d869e2b91aba1a9e64f6bf9a73 (patch) | |
| tree | 912b5cd134b002bedd138d9ee927c072c0da7dc9 | |
| parent | 5abd9c7d15d5e3a82a4bfc978ea7618bba1b9e12 (diff) | |
| parent | b91ab6287952e8ff4f6d6765ed5196825027c903 (diff) | |
| download | rust-61ff887919ba03d869e2b91aba1a9e64f6bf9a73.tar.gz rust-61ff887919ba03d869e2b91aba1a9e64f6bf9a73.zip | |
Rollup merge of #58939 - taeguk:fix-doc-about-pin, r=rkruppe
Fix a tiny error in documentation of std::pin. `new_unmoved` must be `mut` for passing to `std::mem::swap`.
| -rw-r--r-- | src/libcore/pin.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index cf55b6c379d..57bd3ed12b2 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -109,7 +109,7 @@ //! assert_eq!(still_unmoved.slice, NonNull::from(&still_unmoved.data)); //! //! // Since our type doesn't implement Unpin, this will fail to compile: -//! // let new_unmoved = Unmovable::new("world".to_string()); +//! // let mut new_unmoved = Unmovable::new("world".to_string()); //! // std::mem::swap(&mut *still_unmoved, &mut *new_unmoved); //! ``` //! |
