Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions library/core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,15 +831,13 @@
//! <code>fn get_pin_mut(self: [Pin]<[`&mut Self`]>) -> [Pin]<[`&mut T`]></code>.
//! Then we could do the following:
//! ```compile_fail
//! # use std::cell::RefCell;
//! # use std::pin::Pin;
//! fn exploit_ref_cell<T>(rc: Pin<&mut RefCell<T>>) {
//! fn exploit_ref_cell<T>(mut rc: Pin<&mut RefCell<T>>) {
//! // Here we get pinned access to the `T`.
//! let _: Pin<&mut T> = rc.as_mut().get_pin_mut();
//!
//! // And here we have `&mut T` to the same data.
//! let shared: &RefCell<T> = rc.into_ref().get_ref();
//! let borrow = shared.borrow_mut();
//! let mut borrow = shared.borrow_mut();
//! let content = &mut *borrow;
//! }
//! ```
Expand Down
Loading