From 1a6eff747fa5152e6fae64c8ee1167a0c587dc98 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 7 Jul 2025 16:18:35 +0200 Subject: const-block-as-pattern: do not refer to no-longer-existing nightly feature --- compiler/rustc_parse/src/parser/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_parse/src/parser') 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 { -- cgit 1.4.1-3-g733a5