Skip to content

Commit 61ff887

Browse files
authored
Rollup merge of rust-lang#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`.
2 parents 5abd9c7 + b91ab62 commit 61ff887

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
//! assert_eq!(still_unmoved.slice, NonNull::from(&still_unmoved.data));
110110
//!
111111
//! // Since our type doesn't implement Unpin, this will fail to compile:
112-
//! // let new_unmoved = Unmovable::new("world".to_string());
112+
//! // let mut new_unmoved = Unmovable::new("world".to_string());
113113
//! // std::mem::swap(&mut *still_unmoved, &mut *new_unmoved);
114114
//! ```
115115
//!

0 commit comments

Comments
 (0)