unconditionally lower match arm even if it's unneeded for never pattern in match by mu001999 · Pull Request #137742 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation7 Commits1 Checks6 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
fixes #137708
Lowering arm body is skipped when lowering match arm with never pattern, but we may need the HirId for DefId in the body in later passes. And then we got the ICE No HirId for DefId
.
Fixes this by lowering the arm body even if it's unneeded for never pattern in match, so that we can generate HirId and use it then.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right solution but you should provide a better explanation for why this fixes the issue. Right now the PR description is empty, and this is definitely not self-explanatory.
Also maybe "unconditionally lower match arm even if it's unneeded for never pattern in match" is a better title?
mu001999 changed the title
lower body if meet never pattern unconditionally lower match arm even if it's unneeded for never pattern in match
rustbot added the T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to press the "request review" button in the future, all it does is give me an unneeded notification.
📌 Commit d504f70 has been approved by compiler-errors
It is now in the queue for this repository.
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.
bors added the S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…piler-errors
unconditionally lower match arm even if it's unneeded for never pattern in match
fixes rust-lang#137708
Lowering arm body is skipped when lowering match arm with never pattern, but we may need the HirId for DefId in the body in later passes. And then we got the ICE No HirId for DefId
.
Fixes this by lowering the arm body even if it's unneeded for never pattern in match, so that we can generate HirId and use it then.
r? @compiler-errors
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 11 pull requests
Successful merges:
- rust-lang#137045 (Defer repeat expr
Copy
checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277)
- rust-lang#137634 (Update
compiler-builtins
to 0.1.149) - rust-lang#137686 (Handle asm const similar to inline const)
- rust-lang#137689 (Use
Binder<Vec<Ty>>
instead ofVec<Binder<Ty>>
in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats)
- rust-lang#137723 (Make
rust.description
more general-purpose and passCFG_VER_DESCRIPTION
) - rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision)
- rust-lang#137735 (Update E0133 docs for 2024 edition)
- rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match)
- rust-lang#137771 (Tweak incorrect ABI suggestion)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 11 pull requests
Successful merges:
- rust-lang#137045 (Defer repeat expr
Copy
checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277)
- rust-lang#137634 (Update
compiler-builtins
to 0.1.149) - rust-lang#137686 (Handle asm const similar to inline const)
- rust-lang#137689 (Use
Binder<Vec<Ty>>
instead ofVec<Binder<Ty>>
in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats)
- rust-lang#137723 (Make
rust.description
more general-purpose and passCFG_VER_DESCRIPTION
) - rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision)
- rust-lang#137735 (Update E0133 docs for 2024 edition)
- rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match)
- rust-lang#137771 (Tweak incorrect ABI suggestion)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 11 pull requests
Successful merges:
- rust-lang#137045 (Defer repeat expr
Copy
checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277)
- rust-lang#137634 (Update
compiler-builtins
to 0.1.149) - rust-lang#137686 (Handle asm const similar to inline const)
- rust-lang#137689 (Use
Binder<Vec<Ty>>
instead ofVec<Binder<Ty>>
in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats)
- rust-lang#137723 (Make
rust.description
more general-purpose and passCFG_VER_DESCRIPTION
) - rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision)
- rust-lang#137735 (Update E0133 docs for 2024 edition)
- rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match)
- rust-lang#137771 (Tweak incorrect ABI suggestion)
r? @ghost
@rustbot
modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…piler-errors
unconditionally lower match arm even if it's unneeded for never pattern in match
fixes rust-lang#137708
Lowering arm body is skipped when lowering match arm with never pattern, but we may need the HirId for DefId in the body in later passes. And then we got the ICE No HirId for DefId
.
Fixes this by lowering the arm body even if it's unneeded for never pattern in match, so that we can generate HirId and use it then.
r? @compiler-errors
This was referenced
Feb 28, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#137045 (Defer repeat expr
Copy
checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277)
- rust-lang#137686 (Handle asm const similar to inline const)
- rust-lang#137689 (Use
Binder<Vec<Ty>>
instead ofVec<Binder<Ty>>
in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats)
- rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision)
- rust-lang#137735 (Update E0133 docs for 2024 edition)
- rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match)
- rust-lang#137771 (Tweak incorrect ABI suggestion and make suggestion verbose)
Failed merges:
- rust-lang#137723 (Make
rust.description
more general-purpose and passCFG_VER_DESCRIPTION
)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#137742 - mu001999-contrib:fix-137708, r=compiler-errors
unconditionally lower match arm even if it's unneeded for never pattern in match
fixes rust-lang#137708
Lowering arm body is skipped when lowering match arm with never pattern, but we may need the HirId for DefId in the body in later passes. And then we got the ICE No HirId for DefId
.
Fixes this by lowering the arm body even if it's unneeded for never pattern in match, so that we can generate HirId and use it then.
r? @compiler-errors
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.