Skip to content

Make the enum check work for negative discriminants #143273

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

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

1c3t3a
Copy link
Member

@1c3t3a 1c3t3a commented Jul 1, 2025

The discriminant check was not working correctly for negative numbers. This change fixes that by masking out the relevant bits correctly.

Fixes #143218.

@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rust-log-analyzer

This comment has been minimized.

@1c3t3a 1c3t3a force-pushed the enum-check-negative branch from bae4b4f to d417c8b Compare July 1, 2025 10:13
@1c3t3a 1c3t3a force-pushed the enum-check-negative branch from d417c8b to bacb8e8 Compare July 2, 2025 11:12
@rust-log-analyzer

This comment has been minimized.

@1c3t3a 1c3t3a force-pushed the enum-check-negative branch from bacb8e8 to 86d1242 Compare July 2, 2025 11:33
@compiler-errors
Copy link
Member

Please fix the submodules you've updated

The discriminant check was not working correctly for negative numbers.
This change fixes that by masking out the relevant bits correctly.
@1c3t3a 1c3t3a force-pushed the enum-check-negative branch from 86d1242 to 8a0d8dd Compare July 2, 2025 17:03
@1c3t3a
Copy link
Member Author

1c3t3a commented Jul 2, 2025

Upps sorry, here we go!

Copy link
Member

@SparrowLii SparrowLii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@SparrowLii
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 3, 2025

📌 Commit 8a0d8dd has been approved by SparrowLii

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 Jul 3, 2025
bors added a commit that referenced this pull request Jul 3, 2025
Rollup of 9 pull requests

Successful merges:

 - #143192 (Improve CSS for source code block line numbers)
 - #143251 (bootstrap: add build.tidy-extra-checks option)
 - #143273 (Make the enum check work for negative discriminants)
 - #143292 (Explicitly handle all nodes in `generics_of` when computing parent)
 - #143316 (Add bootstrap check snapshot tests)
 - #143321 (byte-addresses memory -> byte-addressed memory)
 - #143324 (interpret: move the native call preparation logic into Miri)
 - #143325 (Use non-global interner in `test_string_interning` in bootstrap)
 - #143327 (miri: improve errors for type validity assertion failures)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ddda937 into rust-lang:master Jul 3, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 3, 2025
rust-timer added a commit that referenced this pull request Jul 3, 2025
Rollup merge of #143273 - 1c3t3a:enum-check-negative, r=SparrowLii

Make the enum check work for negative discriminants

The discriminant check was not working correctly for negative numbers. This change fixes that by masking out the relevant bits correctly.

Fixes #143218.
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Jul 3, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#143192 (Improve CSS for source code block line numbers)
 - rust-lang/rust#143251 (bootstrap: add build.tidy-extra-checks option)
 - rust-lang/rust#143273 (Make the enum check work for negative discriminants)
 - rust-lang/rust#143292 (Explicitly handle all nodes in `generics_of` when computing parent)
 - rust-lang/rust#143316 (Add bootstrap check snapshot tests)
 - rust-lang/rust#143321 (byte-addresses memory -> byte-addressed memory)
 - rust-lang/rust#143324 (interpret: move the native call preparation logic into Miri)
 - rust-lang/rust#143325 (Use non-global interner in `test_string_interning` in bootstrap)
 - rust-lang/rust#143327 (miri: improve errors for type validity assertion failures)

r? `@ghost`
`@rustbot` modify labels: rollup
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
7 participants