-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Clarify documentation about the memory layout of UnsafeCell
#103394
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
Co-authored-by: Ralf Jung <[email protected]>
The new text that was added in this PR and in #101717 cover the topics of memory layout and type conversion. As the text is currently written down, I think we can combine this into one subsection labeled "Memory layout and type conversions", but an alternative could be to detangle the text even further and split it into two subsections "Memory layout" and "Type conversions". As the text is structured now, the only sentence that seems relevant to said memory layout subsection is " |
"Memory layout" sounds good, but "type conversion" sounds like a safe operation, like Maybe just "memory layout"? |
…dditional clarity
Sounds good to me, I just updated the PR. Thanks! |
LGTM, let's see what @Amanieu thinks. |
LGTM! @bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#103110 (remove redundant Send impl for references) - rust-lang#103255 (Clean up hidden type registration) - rust-lang#103394 (Clarify documentation about the memory layout of `UnsafeCell`) - rust-lang#103408 (Clean return-position `impl Trait` in traits correctly in rustdoc) - rust-lang#103505 (rustdoc: parse self-closing tags and attributes in `invalid_html_tags`) - rust-lang#103524 (rustc_metadata: Add struct and variant constructors to module children at encoding time) - rust-lang#103544 (Add flag to forbid recovery in the parser) - rust-lang#103616 (rustdoc: remove CSS workaround for Firefox 29) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This PR addresses a comment by @RalfJung in PR #101717 to further clarify the documentation of
UnsafeCell<T>
. The previous PR was merged already before we had a chance to correct this, hence this second PR :)To goal of this PR is:
UnsafeCell<T>
and the usage ofUnsafeCell::(raw_)get()
into two paragraphs, so that it is easier to digest for the reader.