-
Notifications
You must be signed in to change notification settings - Fork 13k
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
MIR building: Stop using unpack!
for BlockAnd<()>
#127472
Conversation
Some changes occurred in match lowering cc @Nadrieril |
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.
I have a suggestion which you don't necessarily need to take to heart.
r=fmease,Nadrieril if Nadrieril approves as well
This kind of unpacking can be expressed as an ordinary method on `BlockAnd<()>`.
Renamed |
@bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125042 (Use ordinal number in argument error) - rust-lang#127229 (rustdoc: click target for sidebar items flush left) - rust-lang#127337 (Move a few intrinsics to Rust abi) - rust-lang#127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`) - rust-lang#127579 (Solve a error `.clone()` suggestion when moving a mutable reference) - rust-lang#127769 (Don't use implicit features in `Cargo.toml` in `compiler/`) - rust-lang#127844 (Remove invalid further restricting suggestion for type bound) - rust-lang#127855 (Add myself to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125042 (Use ordinal number in argument error) - rust-lang#127229 (rustdoc: click target for sidebar items flush left) - rust-lang#127337 (Move a few intrinsics to Rust abi) - rust-lang#127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`) - rust-lang#127579 (Solve a error `.clone()` suggestion when moving a mutable reference) - rust-lang#127769 (Don't use implicit features in `Cargo.toml` in `compiler/`) - rust-lang#127844 (Remove invalid further restricting suggestion for type bound) - rust-lang#127855 (Add myself to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125042 (Use ordinal number in argument error) - rust-lang#127229 (rustdoc: click target for sidebar items flush left) - rust-lang#127337 (Move a few intrinsics to Rust abi) - rust-lang#127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`) - rust-lang#127579 (Solve a error `.clone()` suggestion when moving a mutable reference) - rust-lang#127769 (Don't use implicit features in `Cargo.toml` in `compiler/`) - rust-lang#127844 (Remove invalid further restricting suggestion for type bound) - rust-lang#127855 (Add myself to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127472 - Zalathar:block-and-unit, r=fmease MIR building: Stop using `unpack!` for `BlockAnd<()>` This is a subset of rust-lang#127416, containing only the parts related to `BlockAnd<()>`. The first patch removes the non-assigning form of the `unpack!` macro, because it is frustratingly inconsistent with the main form. We can replace it with an ordinary method that discards the `()` and returns the block. The second patch then finds all of the remaining code that was using `unpack!` with `BlockAnd<()>`, and updates it to use that new method instead. --- Changes since original review of rust-lang#127416: - Renamed `fn unpack_block` → `fn into_block` - Removed `fn unpack_discard`, replacing it with `let _: BlockAnd<()> = ...` (2 occurrences) - Tweaked `arm_end_blocks` to unpack earlier and build `Vec<BasicBlock>` instead of `Vec<BlockAnd<()>>`
Whoops I hadn't seen that you were waiting for me. LGTM, thx for merging 👍 |
This is a subset of #127416, containing only the parts related to
BlockAnd<()>
.The first patch removes the non-assigning form of the
unpack!
macro, because it is frustratingly inconsistent with the main form. We can replace it with an ordinary method that discards the()
and returns the block.The second patch then finds all of the remaining code that was using
unpack!
withBlockAnd<()>
, and updates it to use that new method instead.Changes since original review of #127416:
fn unpack_block
→fn into_block
fn unpack_discard
, replacing it withlet _: BlockAnd<()> = ...
(2 occurrences)arm_end_blocks
to unpack earlier and buildVec<BasicBlock>
instead ofVec<BlockAnd<()>>