From e9c9d1c305488eb1125d6a10367c81a5c411039c Mon Sep 17 00:00:00 2001 From: Chris Gregory Date: Fri, 12 Apr 2019 01:29:30 -0500 Subject: [PATCH] Add comment that field projectin also works with mutable fields --- src/libcore/pin.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index ad3e2686228c8..e1fe0044cc480 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -171,11 +171,12 @@ //! //! # Projections and Structural Pinning //! -//! One interesting question arises when considering the interaction of pinning and -//! the fields of a struct. When can a struct have a "pinning projection", i.e., -//! an operation with type `fn(Pin<&Struct>) -> Pin<&Field>`? -//! In a similar vein, when can a generic wrapper type (such as `Vec`, `Box`, or `RefCell`) -//! have an operation with type `fn(Pin<&Wrapper>) -> Pin<&T>`? +//! One interesting question arises when considering the interaction of pinning +//! and the fields of a struct. When can a struct have a "pinning projection", +//! i.e., an operation with type `fn(Pin<&Struct>) -> Pin<&Field>`? In a +//! similar vein, when can a generic wrapper type (such as `Vec`, `Box`, +//! or `RefCell`) have an operation with type `fn(Pin<&Wrapper>) -> +//! Pin<&T>` (or similarly `fn(Pin<&mut Wrapper>) -> Pin<&mut T>`)? //! //! Having a pinning projection for some field means that pinning is "structural": //! when the wrapper is pinned, the field must be considered pinned, too.