-
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
Use expose_addr()
in fmt::Pointer
#105682
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
I don't have any strong opinions either way (and see benefits in either approach), but for now r? @RalfJung I suppose? |
This is fine for me but the libs team should be involved.
r? libs
|
Oh wait this PR is from a libs team member.^^
@bors r+
|
Do I understand correctly that what this allows is to take print output, parse it as a number, cast that number back to a pointer and then access memory using that? What is the motivation for allowing that? It makes not practical difference right now, but aspirationally, adding some conditional debug output that happens to print pointer addresses should preferably not impact optimization beyond what is necessary. |
Yes.
It is linked from the OP: there's a non-zero chance of people doing that, and no measurable cost to allowing it. |
Rollup of 5 pull requests Successful merges: - rust-lang#105682 (Use `expose_addr()` in `fmt::Pointer`) - rust-lang#105839 (Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators) - rust-lang#105864 (clippy::complexity fixes) - rust-lang#105882 (Don't ICE in closure arg borrow suggestion) - rust-lang#105889 (Fix `uninlined_format_args` in libtest) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/Should.20.60fmt.3A.3APointer.60.20expose.20the.20argument.3F on whether or not we should do this (still undecided).
CC @RalfJung