LivenessValues: use dedicated enum rather than mutually exclusive Options#157035
Merged
Merged
Conversation
Collaborator
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
04c1272 to
e8beadf
Compare
Contributor
Author
|
Sorry, read through the diff AGAIN and of course noticed a few mistakes I hadn't seen in the terminal window. |
Member
|
Pls use an enum instead of Either, then r=me @bors delegate+ |
Contributor
|
✌️ @amandasystems, you can now approve this pull request! If @jackh726 told you to " |
e8beadf to
6d67c7d
Compare
LivenessValues: use Either rather than mutually exclusive OptionsLivenessValues: use dedicated enum rather than mutually exclusive Options
lqd
reviewed
Jun 1, 2026
6d67c7d to
a5b1187
Compare
Contributor
Author
|
That seems spurious to me but I can’t find a bors or rustbot command to restart CI. If anyone who can do that reads this please do! |
Member
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 2, 2026
…, r=jackh726 `LivenessValues`: use dedicated enum rather than mutually exclusive `Option`s I was reading through `LivenessValues` and realised it had a lot of comments explaining that two `Option`s were mutually exclusive, plus some redundant logic to handle this. This is a drive-by fix to use ~~an `Either`~~ a dedicated enum instead, which makes that property obvious from the code. It also removes the repeated logic.
This was referenced Jun 2, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 2, 2026
…uwer Rollup of 9 pull requests Successful merges: - #157035 (`LivenessValues`: use dedicated enum rather than mutually exclusive `Option`s) - #157182 (Restore simpler Encode/Decode impls for u32 and (on 64bit systems) usize) - #157310 (rustdoc: Render `impl` restriction) - #157070 (Remove `skip_arg` attribute from `Diagnostic` and `Subdiagnostic` proc-macros) - #157137 (rustc_target: Use +spe for powerpcspe targets) - #157215 (Implement argument-dependent target checking for the `#[repr]` parser) - #157235 (additional changes for issue-144595) - #157321 (Remove unnecessary arm in `handle_res`) - #157324 (Add test for undefined EII static error)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 2, 2026
…uwer Rollup of 9 pull requests Successful merges: - #157035 (`LivenessValues`: use dedicated enum rather than mutually exclusive `Option`s) - #157182 (Restore simpler Encode/Decode impls for u32 and (on 64bit systems) usize) - #157310 (rustdoc: Render `impl` restriction) - #157070 (Remove `skip_arg` attribute from `Diagnostic` and `Subdiagnostic` proc-macros) - #157137 (rustc_target: Use +spe for powerpcspe targets) - #157215 (Implement argument-dependent target checking for the `#[repr]` parser) - #157235 (additional changes for issue-144595) - #157321 (Remove unnecessary arm in `handle_res`) - #157324 (Add test for undefined EII static error)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 2, 2026
…uwer Rollup of 9 pull requests Successful merges: - #157035 (`LivenessValues`: use dedicated enum rather than mutually exclusive `Option`s) - #157182 (Restore simpler Encode/Decode impls for u32 and (on 64bit systems) usize) - #157310 (rustdoc: Render `impl` restriction) - #157070 (Remove `skip_arg` attribute from `Diagnostic` and `Subdiagnostic` proc-macros) - #157137 (rustc_target: Use +spe for powerpcspe targets) - #157215 (Implement argument-dependent target checking for the `#[repr]` parser) - #157235 (additional changes for issue-144595) - #157321 (Remove unnecessary arm in `handle_res`) - #157324 (Add test for undefined EII static error)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was reading through
LivenessValuesand realised it had a lot of comments explaining that twoOptions were mutually exclusive, plus some redundant logic to handle this.This is a drive-by fix to use
ana dedicated enum instead, which makes that property obvious from the code. It also removes the repeated logic.Either