Skip to content
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

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Conversation

thomcc
Copy link
Member

@thomcc thomcc commented Dec 14, 2022

@rustbot
Copy link
Collaborator

rustbot commented Dec 14, 2022

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 14, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 14, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@Mark-Simulacrum
Copy link
Member

I don't have any strong opinions either way (and see benefits in either approach), but for now r? @RalfJung I suppose?

@rustbot rustbot assigned RalfJung and unassigned Mark-Simulacrum Dec 17, 2022
@RalfJung
Copy link
Member

RalfJung commented Dec 18, 2022 via email

@rustbot rustbot assigned m-ou-se and unassigned RalfJung Dec 18, 2022
@RalfJung
Copy link
Member

RalfJung commented Dec 18, 2022 via email

@bors
Copy link
Contributor

bors commented Dec 18, 2022

📌 Commit f2d0366 has been approved by RalfJung

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 18, 2022
@nikic
Copy link
Contributor

nikic commented Dec 18, 2022

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.

@RalfJung
Copy link
Member

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?

Yes.

What is the motivation for allowing that?

It is linked from the OP: there's a non-zero chance of people doing that, and no measurable cost to allowing it.

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 19, 2022
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
@bors bors merged commit f74bcfb into rust-lang:master Dec 19, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants