-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Change more x64 size checks to not apply to x32. #88668
Conversation
Commit 95e096d changed a bunch of size checks already, but more have been added, so this fixes the new ones the same way: the various size checks that are conditional on target_arch = "x86_64" were not intended to apply to x86_64-unknown-linux-gnux32, so add target_pointer_width = "64" to the conditions.
(rust-highfive has picked a reviewer for you, use r? to override) |
Do these even need the target_arch at all and not just the pointer width? |
Good question. I think some of the checks could potentially fail if some target has 64-bit pointers that do not require 64-bit alignment, but I do not know whether Rust supports any such target. I wouldn't want to have that change as part of this one in case it needs to be reverted (the revert would break x32 again), but I can submit it as a followup PR if you like. |
r? @joshtriplett who seems to know more about this |
Does (See also #65473 that tracks |
That's not clear to me from the specification. https://doc.rust-lang.org/reference/conditional-compilation.html#target_pointer_width just says "Key-value option set once with the target's pointer width in bits."
Let's play it safe and forget about that for now, then.
The current patch wouldn't cause issues for that, as it doesn't enable any static asserts that were previously disabled: any assert that would fail with this patch already fails the same way without this patch. |
Agreed :) and there are already asserts of that form elsewhere |
This seems reasonable to me. @bors r+ |
📌 Commit cd75af2 has been approved by |
Change more x64 size checks to not apply to x32. Commit 95e096d changed a bunch of size checks already, but more have been added, so this fixes the new ones the same way: the various size checks that are conditional on target_arch = "x86_64" were not intended to apply to x86_64-unknown-linux-gnux32, so add target_pointer_width = "64" to the conditions.
Change more x64 size checks to not apply to x32. Commit 95e096d changed a bunch of size checks already, but more have been added, so this fixes the new ones the same way: the various size checks that are conditional on target_arch = "x86_64" were not intended to apply to x86_64-unknown-linux-gnux32, so add target_pointer_width = "64" to the conditions.
…ingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#87904 (Reword description of automatic impls of `Unsize`.) - rust-lang#88147 (Fix non-capturing closure return type coercion) - rust-lang#88209 (Improve error message when _ is used for in/inout asm operands) - rust-lang#88668 (Change more x64 size checks to not apply to x32.) - rust-lang#88733 (Fix ICE for functions with more than 65535 arguments) - rust-lang#88757 (Suggest wapping expr in parentheses on invalid unary negation) - rust-lang#88779 (Use more accurate spans for "unused delimiter" lint) - rust-lang#88830 (Add help for E0463) - rust-lang#88849 (don't clone types that are Copy (clippy::clone_on_copy)) - rust-lang#88850 (don't convert types into identical types) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Commit 95e096d changed a bunch of size checks already, but more have
been added, so this fixes the new ones the same way: the various size
checks that are conditional on target_arch = "x86_64" were not intended
to apply to x86_64-unknown-linux-gnux32, so add
target_pointer_width = "64" to the conditions.