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 field-offset and enable unstable_offset_of #112298

Merged
merged 1 commit into from
Jun 10, 2023

Conversation

est31
Copy link
Member

@est31 est31 commented Jun 5, 2023

This makes the compiler use the builtin offset_of!() macro, through the wrappers in memoffset and then in field-offset.

cc #111839

@rustbot
Copy link
Collaborator

rustbot commented Jun 5, 2023

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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 5, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jun 5, 2023

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@est31 est31 mentioned this pull request Jun 5, 2023
16 tasks
Cargo.lock Outdated Show resolved Hide resolved
This enables usage of the offset_of!() macro in the compiler,
through the wrappers in memoffset and then in field-offset.
@est31 est31 force-pushed the update_field_offset branch from cbd4902 to b048396 Compare June 5, 2023 13:57
@rustbot rustbot added the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Jun 5, 2023
@@ -25,5 +24,8 @@ rustc_span = { path = "../rustc_span" }
thin-vec = "0.2.12"
tracing = "0.1"

# Not used directly, but included to enable the unstable_offset_of feature
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the comment still accurate? this crate had the dep before

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, unstable_const feature lost, maybe it needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grep for memoffset, there is no results.

Before it was included to enable the unstable_const feature, which <enabled usage of the pointer::offset_from function, but that function is not used if unstable_offset_of is enabled as that directly uses offset_of!().

The offset_of_tuple macro still doesn't use offset_of so unstable_const does something to the public API of memoffset still, but that macro is not used I think neither by rustc nor by any of its deps, at least that's my impression.

In other words, enabling unstable_const makes no sense at this point.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 10, 2023

📌 Commit b048396 has been approved by Mark-Simulacrum

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

Rollup of 5 pull requests

Successful merges:

 - rust-lang#112297 (bootstrap: Disallow `--exclude test::std`)
 - rust-lang#112298 (Update field-offset and enable unstable_offset_of)
 - rust-lang#112335 (ci: Upgrade loongarch64-linux-gnu GCC to 13.1.0)
 - rust-lang#112413 (Adjust span labels for `HIDDEN_GLOB_REEXPORTS`)
 - rust-lang#112483 (Add deprecation warning to python versions <3.6 in x.py)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e3656ff into rust-lang:master Jun 10, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants