rust/src
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
..
bootstrap Rollup merge of #149921 - Kobzol:src-gpl, r=Mark-Simulacrum 2025-12-28 18:16:10 +01:00
build_helper Use yarn instead of npm in tidy 2025-11-17 10:58:13 +02:00
ci Rollup merge of #149964 - Mark-Simulacrum:ci-channel, r=Kobzol 2025-12-25 21:11:53 +01:00
doc Document relative and absolute paths handling in --remap-path-prefix 2025-12-26 16:38:46 +01:00
etc fixup debugger files wrt to MaybeDangling 2025-12-26 22:02:17 +01:00
gcc@0081ca6631 Update GCC submodule 2025-11-26 20:11:43 +01:00
librustdoc Rollup merge of #150362 - heathdutton:fix-rustdoc-duplicate-reexports-150211, r=notriddle 2025-12-27 15:46:55 +01:00
llvm-project@00d23d10dc Update LLVM submodule 2025-12-20 09:53:08 +08:00
rustc-std-workspace Generalize branch references to HEAD 2025-11-02 11:15:55 +01:00
rustdoc-json-types rustdoc-json: add rlib path to ExternalCrate to enable robust crate resolution 2025-11-21 09:22:59 +00:00
tools Rollup merge of #149667 - Shinonn23:fix-ice-constblock-148138, r=dianne 2025-12-28 22:52:31 +01:00
README.md
stage0 bump stage0 2025-12-19 15:04:30 -08:00
version bump version number 2025-12-05 19:33:24 +00:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.