Files
rust/tests/ui/pattern
Jonathan Brouwer ef835a83ee Rollup merge of #149667 - Shinonn23:fix-ice-constblock-148138, r=dianne
Fix ICE by rejecting const blocks in patterns during AST lowering (closes #148138)

This PR fixes the ICE reported in rust-lang/rust#148138.

The root cause is that `const` blocks aren’t allowed in pattern position, but the AST lowering logic still attempted to create `PatExprKind::ConstBlock`, allowing invalid HIR to reach type checking and trigger a `span_bug!`.

Following the discussion in the issue, this patch removes the `ConstBlock` lowering path from `lower_expr_within_pat`. Any `ExprKind::ConstBlock` inside a pattern is now handled consistently with other invalid pattern expressions.

A new UI test is included to ensure the compiler reports a proper error and to prevent regressions.

Closes rust-lang/rust#148138.
2025-12-28 22:52:31 +01:00
..
2025-05-03 17:22:52 +02:00
2025-11-27 14:13:58 -05:00
2025-12-02 18:25:13 +00:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-08-09 16:27:20 +05:00
2025-11-27 14:13:58 -05:00
2024-02-09 15:43:08 -03:00
2024-02-09 15:43:08 -03:00
2024-04-29 14:53:38 +02:00
2024-03-27 11:20:28 -04:00
2025-11-27 11:19:00 -05:00
2025-08-09 16:27:20 +05:00
2024-01-13 12:46:58 -05:00
2024-11-21 18:40:36 +08:00
2024-11-21 18:40:36 +08:00
2025-06-11 15:30:15 +01:00
2025-08-09 16:27:20 +05:00
2025-08-09 16:27:20 +05:00
2025-08-09 16:27:20 +05:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-08-09 16:27:20 +05:00