-
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
Only assert the Parser
size on specific arches
#135855
base: master
Are you sure you want to change the base?
Conversation
The size of this struct depends on the alignment of `u128`, for example powerpc64le and s390x have align-8 and end up with only 280 bytes. Our 64-bit tier-1 arches are the same though, so let's just assert on those.
Could not assign reviewer from: |
I'm nominating this for backport because I ran into this problem on Fedora for 1.85-beta: @rustbot label +beta-nominated |
Nick is on vacation so the assignment didn't go through but I think we can go-ahead and merge this now. @bors r+ |
// nonterminals. Make sure it doesn't unintentionally get bigger. | ||
#[cfg(all(target_pointer_width = "64", not(target_arch = "s390x")))] | ||
// nonterminals. Make sure it doesn't unintentionally get bigger. We only check a few arches | ||
// though, because `TokenTypeSet(u128)` alignment varies on others, changing the total size. |
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.
Not this PR, and I don't know if it's worth bothering, but could try changing the other type to a https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/packed/struct.Pu128.html so it'd be smaller on x64 too.
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.
Either that, or put #[repr(packed(8))]
directly on TokenTypeSet
too. I have no idea if there are enough of these being passed around to really matter though.
Only assert the `Parser` size on specific arches The size of this struct depends on the alignment of `u128`, for example powerpc64le and s390x have align-8 and end up with only 280 bytes. Our 64-bit tier-1 arches are the same though, so let's just assert on those. r? nnethercote
Rollup of 8 pull requests Successful merges: - rust-lang#135557 (Point at invalid utf-8 span on user's source code) - rust-lang#135596 (Properly note when query stack is being cut off) - rust-lang#135638 (Make it possible to build GCC on CI) - rust-lang#135648 (support wasm inline assembly in `naked_asm!`) - rust-lang#135826 (Misc. `rustc_resolve` cleanups) - rust-lang#135827 (CI: free disk with in-tree script instead of GitHub Action) - rust-lang#135850 (Update the `wasm-component-ld` tool) - rust-lang#135855 (Only assert the `Parser` size on specific arches) r? `@ghost` `@rustbot` modify labels: rollup
The size of this struct depends on the alignment of
u128
, for examplepowerpc64le and s390x have align-8 and end up with only 280 bytes. Our
64-bit tier-1 arches are the same though, so let's just assert on those.
r? nnethercote