-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Suggest using as_ref
on *const T
#61444
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit eb73b73 has been approved by |
…jasper Suggest using `as_ref` on `*const T` Fix rust-lang#21596.
…jasper Suggest using `as_ref` on `*const T` Fix rust-lang#21596.
…jasper Suggest using `as_ref` on `*const T` Fix rust-lang#21596.
Rollup of 13 pull requests Successful merges: - #61135 (Fix documentation of `Rc::make_mut` regarding `rc::Weak`.) - #61404 (miri unsizing: fix projecting into a field of an operand) - #61409 (Fix an ICE with a const argument in a trait) - #61413 (Re-implement async fn drop order lowering ) - #61419 (Add an unusual-conversion example to to_uppercase) - #61420 (Succinctify splice docs) - #61444 (Suggest using `as_ref` on `*const T`) - #61446 (On TerminatorKind::DropAndReplace still handle unused_mut correctly) - #61485 (azure: retry s3 upload if it fails) - #61489 (ci: Reenable step timings on AppVeyor) - #61496 (Do not panic in tidy on unbalanced parentheses in cfg's) - #61497 (Treat 0 as special value for codegen-units-std) - #61499 (Add regression test for existential type ICE #53457) Failed merges: r? @ghost
Might be a good place to mention that this is UB if the pointer is dangling, unaligned or does not point to initialized memory -- even if the result reference is never used? |
@RalfJung sounds reasonable. Can you file a follow up ticket? |
I was thinking maybe adding that to the I have adding it to the docs on my list. |
I think minimizing the requirement of having the docs open is a good thing. Basically anything I would tell someone when pair programming should be in the diagnostic itself, and this would count. I feel the diagnostics are part of the documentation, and the clarification should certainly be in the proper docs as well. |
Issue opened at #61786. |
Fix #21596.