-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove [mut] syntax in pin docs #59900
Remove [mut] syntax in pin docs #59900
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @Centril |
So some precision is lost here... I'm not sure how I feel about that so I'm going to r? @RalfJung |
src/libcore/pin.rs
Outdated
@@ -173,13 +173,13 @@ | |||
//! | |||
//! 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<&[mut] Struct>) -> Pin<&[mut] Field>`? | |||
//! an operation with type `fn(Pin<&Struct>) -> Pin<&Field>`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a parenthetical like ("or similarly with &mut
")?
src/libcore/pin.rs
Outdated
//! i.e., an operation with type `fn(Pin<&Struct>) -> Pin<&Field>`? In a | ||
//! similar vein, when can a generic wrapper type (such as `Vec<T>`, `Box<T>`, | ||
//! or `RefCell<T>`) have an operation with type `fn(Pin<&Wrapper<T>>) -> | ||
//! Pin<&T>` (or similarly `fn(Pin<&mut Wrapper<T>>) -> Pin<&mut T>`)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it may be read like only the Wrapper
thing also applies to mut
. That's why I was a bit more vague in my suggestion.
If you think that is too vague, what about instead just being explicit: "(Whenever shared references are used in this discussion, the same applies equally to mutable references.)"
Check this out @RalfJung |
Thanks! @bors r+ rollup |
📌 Commit b754b8f has been approved by |
…in-pin-docs, r=RalfJung Remove [mut] syntax in pin docs Resolves rust-lang#59832
…in-pin-docs, r=RalfJung Remove [mut] syntax in pin docs Resolves rust-lang#59832
…in-pin-docs, r=RalfJung Remove [mut] syntax in pin docs Resolves rust-lang#59832
Rollup of 7 pull requests Successful merges: - #59856 (update polonius-engine) - #59877 (HirIdify hir::Def) - #59896 (Remove duplicated redundant spans) - #59900 (Remove [mut] syntax in pin docs) - #59906 (Make BufWriter use get_mut instead of manipulating inner in Write implementation) - #59936 (Fix cross-crate visibility of fictive variant constructors) - #59957 (Add missing backtick to Symbol documentation.) Failed merges: r? @ghost
Resolves #59832