-
Notifications
You must be signed in to change notification settings - Fork 13k
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
add raw ptr variant of UnsafeCell::get #66248
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
Also Cc @SimonSapin because of the relation to |
As the code comment notes, this can be a simple pointer case because of So I suppose the question is: is it easier for users to find a method than to figure out that a pointer cast is the way to go? Even if we have documentation (perhaps on |
IOW, this is a case of libstd using its special status. |
Good points. r=me with:
|
Also why one may want to use it over |
Co-Authored-By: Mazdak Farrokhzad <[email protected]>
@SimonSapin @the8472 I expanded the docs, please check. |
Docs look good. r=me, pending the method receiver type discussion above. |
@bors r=SimonSapin |
📌 Commit 861698a has been approved by |
…onSapin add raw ptr variant of UnsafeCell::get This has come up recently in rust-lang#66051 (Cc @Centril @pitdicker) as well as in discussion with @nikomatsakis and in unrelated discussion with @withoutboats.
…onSapin add raw ptr variant of UnsafeCell::get This has come up recently in rust-lang#66051 (Cc @Centril @pitdicker) as well as in discussion with @nikomatsakis and in unrelated discussion with @withoutboats.
Rollup of 14 pull requests Successful merges: - #65932 (download .tar.xz if python3 is used) - #66094 (Fix documentation for `Iterator::count()`.) - #66166 (rename cfg(rustdoc) into cfg(doc)) - #66186 (Add long error explanation for E0623) - #66227 (docs: Fix link to BufWriter::flush) - #66248 (add raw ptr variant of UnsafeCell::get) - #66292 (add Result::map_or) - #66297 (Add a callback that allows compiler consumers to override queries.) - #66317 (Use a relative bindir for rustdoc to find rustc) - #66330 (Improve non-exhaustiveness handling in usefulness checking) - #66331 (Add some tests for fixed ICEs) - #66334 (Move Session fields to CrateStore) - #66335 (Move self-profile infrastructure to data structures) - #66337 (Remove dead code for encoding/decoding lint IDs) Failed merges: r? @ghost
☔ The latest upstream changes (presumably #66366) made this pull request unmergeable. Please resolve the merge conflicts. |
This has come up recently in #66051 (Cc @Centril @pitdicker) as well as in discussion with @nikomatsakis and in unrelated discussion with @withoutboats.