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

Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths #121753

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

mu001999
Copy link
Contributor

@mu001999 mu001999 commented Feb 28, 2024

Detected by #121752

Only one AlignmentEnum would be used with a specified target_pointer_width

@rustbot
Copy link
Collaborator

rustbot commented Feb 28, 2024

r? @cuviper

rustbot has assigned @cuviper.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 28, 2024
@@ -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 {
Copy link
Member

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.

@cuviper
Copy link
Member

cuviper commented Feb 28, 2024

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.

@mu001999 mu001999 changed the title Add proper cfg Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths Feb 29, 2024
@mu001999 mu001999 changed the title Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths WIP: Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths Feb 29, 2024
@mu001999 mu001999 changed the title WIP: Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths Feb 29, 2024
@rust-log-analyzer

This comment has been minimized.

@cuviper
Copy link
Member

cuviper commented Feb 29, 2024

Tests that happen to mention the numbered name in expected output will need to be updated.

@rust-log-analyzer

This comment has been minimized.

@cuviper
Copy link
Member

cuviper commented Feb 29, 2024

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 29, 2024

📌 Commit 88b9e7a has been approved by cuviper

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 Feb 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 29, 2024
…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
@bors bors merged commit 2fdcdd9 into rust-lang:master Mar 1, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 1, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2024
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
@mu001999 mu001999 deleted the core/add_cfg branch March 11, 2024 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants