Fix ICE by rejecting const blocks in patterns during AST lowering (closes #148138) by Shinonn23 · Pull Request #149667 · rust-lang/rust (original) (raw)
Looks good to me; thanks! One last request: could you fix the PR and commit descriptions? Specifically,
Any
ExprKind::ConstBlockinside a pattern now lowers toPatKind::Err, consistent with how other invalid pattern expressions are handled.
This isn't the case. Invalid expression patterns lower to PatKind::Expr of PatExprKind::Lit representing a LitKind::Err. This doesn't need to be in the PR description, but I'd like to make sure whatever details are there are accurate. ^^
I think it'd be fine without that sentence, but it also wouldn't hurt to keep the detail about being consistent with how other invalid pattern expressions are handled. I'll leave the particulars up to you.
- Removed
Pat::ConstBlockPatfrom Rust Analyzer.
This is no longer part of the PR.
- Cleaned up Clippy and other tools.
No other tools needed cleanup. And this is just a nit, but I think the clippy change could count as part of removing PatExprKind::ConstBlock from the HIR; there shouldn't be any other cleanup to clippy.