const-block-as-pattern: do not refer to no-longer-existing nightly feature

This commit is contained in:
Ralf Jung
2025-07-07 16:18:35 +02:00
parent c83e217d26
commit 1a6eff747f
3 changed files with 7 additions and 5 deletions

View File

@@ -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 {