Skip to content

Commit

Permalink
Rollup merge of rust-lang#58939 - taeguk:fix-doc-about-pin, r=rkruppe
Browse files Browse the repository at this point in the history
Fix a tiny error in documentation of std::pin.

`new_unmoved` must be `mut` for passing to `std::mem::swap`.
  • Loading branch information
Centril authored Mar 19, 2019
2 parents 5abd9c7 + b91ab62 commit 61ff887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
//! ```
//!
Expand Down

0 comments on commit 61ff887

Please sign in to comment.