-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This enables usage of the offset_of!() macro in the compiler, through the wrappers in memoffset and then in field-offset.
cbd4902
to
b048396
Compare
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@bors r+ rollup |
…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
This makes the compiler use the builtin
offset_of!()
macro, through the wrappers in memoffset and then in field-offset.cc #111839