diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-08 03:09:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-08 03:09:58 +0200 |
| commit | 65dded838703fddfb8f3f9b3e4741cb4e34b9f06 (patch) | |
| tree | dd2724360e192b72ad4a694c414a5b267ded15e2 /compiler/rustc_parse/src | |
| parent | 1a45ab116d242a4348748eeef9a7fe9ac4c4cd4e (diff) | |
| parent | 1a6eff747fa5152e6fae64c8ee1167a0c587dc98 (diff) | |
| download | rust-65dded838703fddfb8f3f9b3e4741cb4e34b9f06.tar.gz rust-65dded838703fddfb8f3f9b3e4741cb4e34b9f06.zip | |
Rollup merge of #143589 - RalfJung:const-pat, r=compiler-errors
const-block-as-pattern: do not refer to no-longer-existing nightly feature Surely everyone who used this nightly feature has fixed their code by now. So let's not confused people on stable that try to use a const block as a pattern by referring to some dead nightly feature.
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index cfc0399b0ca..2787be46f33 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -1293,8 +1293,10 @@ impl<'a> Parser<'a> { let kind = if pat { let guar = self .dcx() - .struct_span_err(blk_span, "`inline_const_pat` has been removed") - .with_help("use a named `const`-item or an `if`-guard instead") + .struct_span_err(blk_span, "const blocks cannot be used as patterns") + .with_help( + "use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead", + ) .emit(); ExprKind::Err(guar) } else { |
