-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths #121753
Conversation
0b0cde5
to
f36562e
Compare
library/core/src/ptr/alignment.rs
Outdated
@@ -240,6 +240,7 @@ type AlignmentEnum = AlignmentEnum32; | |||
#[cfg(target_pointer_width = "64")] | |||
type AlignmentEnum = AlignmentEnum64; | |||
|
|||
#[cfg(target_pointer_width = "16")] | |||
#[derive(Copy, Clone, PartialEq, Eq)] | |||
#[repr(u16)] | |||
enum AlignmentEnum16 { |
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.
If these are only used for the type AlignmentEnum
alias above, I wonder why we shouldn't just define them as enum AlignmentEnum
directly.
Meta: in general, please add more descriptive context to your PR title and comment. A link is a useful supplement, but it should be made clear what we're changing and why, without needing to click around. |
f36562e
to
61fcdf6
Compare
This comment has been minimized.
This comment has been minimized.
Tests that happen to mention the numbered name in expected output will need to be updated. |
This comment has been minimized.
This comment has been minimized.
0d3954a
to
88b9e7a
Compare
Thanks! @bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#121326 (Detect empty leading where clauses on type aliases) - rust-lang#121464 (rustc: Fix wasm64 metadata object files) - rust-lang#121681 (Safe Transmute: Revise safety analysis) - rust-lang#121753 (Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths) - rust-lang#121782 (allow statics pointing to mutable statics) - rust-lang#121798 (Fix links in rustc doc) - rust-lang#121806 (add const test for ptr::metadata) - rust-lang#121809 (Remove doc aliases to PATH) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121753 - mu001999:core/add_cfg, r=cuviper Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths Detected by rust-lang#121752 Only one AlignmentEnum would be used with a specified target_pointer_width
Detected by #121752
Only one AlignmentEnum would be used with a specified target_pointer_width