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

Update NonZero and NonNull to not field-project (per MCP#807) #133651

Merged

Conversation

scottmcm
Copy link
Member

rust-lang/compiler-team#807 (comment) was accepted, so this is the first PR towards moving the library to not using field projections into [rustc_layout_scalar_valid_range_*] types.

NonZero was already using transmute nearly everywhere, so there are very few changes to it.

NonNull needed more changes, but they're mostly simple, changing .pointer to .as_ptr().

r? libs

cc #133324, which will tidy up some of the MIR from this a bit more, but isn't a blocker.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 29, 2024
@oli-obk oli-obk assigned oli-obk and unassigned workingjubilee Dec 2, 2024
@scottmcm scottmcm force-pushed the nonnull-nonzero-no-field-projection branch from d2d9fbd to 9301b5c Compare December 3, 2024 19:11
@rustbot

This comment was marked as outdated.

@scottmcm scottmcm force-pushed the nonnull-nonzero-no-field-projection branch from 9301b5c to 7afce4f Compare December 3, 2024 19:13
@scottmcm
Copy link
Member Author

scottmcm commented Dec 3, 2024

Sorry, accidentally pushed a different version of this temporarily.

Diff since your review, @oli-obk, is https://github.com/rust-lang/rust/compare/d2d9fbd5749fc9849d343e17f4fcfd5a9060201e..7afce4f06a56dc1344f54e179a0785b95700df5f

@scottmcm scottmcm removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 3, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Dec 4, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Dec 4, 2024

📌 Commit 7afce4f has been approved by oli-obk

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 4, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 4, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#133651 (Update `NonZero` and `NonNull` to not field-project (per MCP#807))
 - rust-lang#133764 (rustdoc: Rename `set_back_info` to `restore_module_data`.)
 - rust-lang#133784 (Fix MutVisitor's default implementations to visit Stmt's and BinOp's spans)
 - rust-lang#133798 (stop replacing bivariant args with `'static` when computing closure requirements)
 - rust-lang#133804 (Improve code for FileName retrieval in rustdoc)
 - rust-lang#133817 (Use `eprintln` instead of `println` in bootstrap/compiletest/tidy)

Failed merges:

 - rust-lang#133810 (remove unnecessary `eval_verify_bound`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 68f8a53 into rust-lang:master Dec 4, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 4, 2024
Rollup merge of rust-lang#133651 - scottmcm:nonnull-nonzero-no-field-projection, r=oli-obk

Update `NonZero` and `NonNull` to not field-project (per MCP#807)

rust-lang/compiler-team#807 (comment) was accepted, so this is the first PR towards moving the library to not using field projections into `[rustc_layout_scalar_valid_range_*]` types.

`NonZero` was already using `transmute` nearly everywhere, so there are very few changes to it.

`NonNull` needed more changes, but they're mostly simple, changing `.pointer` to `.as_ptr()`.

r? libs

cc rust-lang#133324, which will tidy up some of the MIR from this a bit more, but isn't a blocker.
@scottmcm scottmcm deleted the nonnull-nonzero-no-field-projection branch December 4, 2024 18:01
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.

5 participants