Skip to content

Commit e9c9d1c

Browse files
committed
Add comment that field projectin also works with mutable fields
1 parent 94a5c3b commit e9c9d1c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/libcore/pin.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,12 @@
171171
//!
172172
//! # Projections and Structural Pinning
173173
//!
174-
//! One interesting question arises when considering the interaction of pinning and
175-
//! the fields of a struct. When can a struct have a "pinning projection", i.e.,
176-
//! an operation with type `fn(Pin<&Struct>) -> Pin<&Field>`?
177-
//! In a similar vein, when can a generic wrapper type (such as `Vec<T>`, `Box<T>`, or `RefCell<T>`)
178-
//! have an operation with type `fn(Pin<&Wrapper<T>>) -> Pin<&T>`?
174+
//! One interesting question arises when considering the interaction of pinning
175+
//! and the fields of a struct. When can a struct have a "pinning projection",
176+
//! i.e., an operation with type `fn(Pin<&Struct>) -> Pin<&Field>`? In a
177+
//! similar vein, when can a generic wrapper type (such as `Vec<T>`, `Box<T>`,
178+
//! or `RefCell<T>`) have an operation with type `fn(Pin<&Wrapper<T>>) ->
179+
//! Pin<&T>` (or similarly `fn(Pin<&mut Wrapper<T>>) -> Pin<&mut T>`)?
179180
//!
180181
//! Having a pinning projection for some field means that pinning is "structural":
181182
//! when the wrapper is pinned, the field must be considered pinned, too.

0 commit comments

Comments
 (0)