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`.
This commit is contained in:
commit
61ff887919
@ -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);
|
||||
//! ```
|
||||
//!
|
||||
|
Loading…
x
Reference in New Issue
Block a user