-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rewrite pin
module documentation to clarify usage and invariants
#116129
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
bfd63b2
Rewrite `Pin<P>` docs to clarify guarantees and uses
mcy 8241ca6
mostly done
fu5ha ba3b934
Fix examples, finish polishing
fu5ha 584f098
fix broken links
fu5ha ec8a01a
fix one more broken link
fu5ha 46f9d77
update doubly linked list commentary and fix links
fu5ha db5b19e
improve intro and `Unpin`-related discussion
fu5ha 6818d92
improve intro and discussion of pinning as library contract
fu5ha bebbe24
improve `Pin` struct docs and add examples
fu5ha 82a6817
fix link in footnote
fu5ha e2e8746
reword unpin auto impl section
fu5ha 7c9c712
improve structural Unpin + formatting
fu5ha 252a83b
add section on manual owning ptr managed solution via @kpreid
fu5ha f2447a6
fix typos
fu5ha 921d37d
fix imports
fu5ha 6d5f43d
edit new section for typos and better wording
fu5ha de2e748
fix typos and edit prose
fu5ha 6e88279
`Pin<P>` -> `Pin<Ptr>`
fu5ha 469c78b
improve `Pin` and `Pin::new` docs
fu5ha e0210e6
justify motivation of `Unpin` better
fu5ha f0827b3
fix broken link
fu5ha d7a886a
update ui tests
fu5ha 9997114
improve `Pin::new_unchecked` docs
fu5ha 058fb50
trim section on managed-box model
fu5ha 0050676
Rephrase unpin docs in terms of pinning-agnosticness
Manishearth 936ceb2
lifetime -> lifespan where relevant. improve docs on as_ref()
Manishearth 4c25246
Clean up guarantees wording
Manishearth 68bdedd
Apply suggestions from code review
Manishearth 6553d0d
punctuation in parens
Manishearth 6a54ed7
valid
Manishearth a573c7c
footnote on dropping futures
Manishearth b1830f1
clean up structural pinning
Manishearth df6d449
Update library/core/src/pin.rs
Manishearth 7fd841c
link
Manishearth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Potential concern:
Unpin
types are pinning agnostic in the sense that pinning makes no difference for them. That doesn't mean they don't expose nor rely on any pinning guarantees! For instance, we could define a typePinBox
of a box that's always pinned, and we could mark that typeUnpin
, sincePin<PinBox<T>>
andPinBox<T>
make the same guarantees -- in both cases, theT
is pinned.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.
Seems footnote worthy. That's a bit of a rabbithole for most people reading this, but I agree we should call it out. I'm not the best person to write copy for this.