From 528d45af18b90ec9833568420a34d4e6050b1ec6 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Tue, 26 Mar 2024 01:23:26 -0400 Subject: Feature gate --- compiler/rustc_parse/src/parser/pat.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_parse') diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs index ead00c3f0d4..59e0cd92c4c 100644 --- a/compiler/rustc_parse/src/parser/pat.rs +++ b/compiler/rustc_parse/src/parser/pat.rs @@ -779,6 +779,10 @@ impl<'a> Parser<'a> { self.ban_mut_general_pat(mut_span, &pat, changed_any_binding); } + if matches!(pat.kind, PatKind::Ident(BindingAnnotation(ByRef::Yes(_), Mutability::Mut), ..)) + { + self.psess.gated_spans.gate(sym::mut_ref, pat.span); + } Ok(pat.into_inner().kind) } -- cgit 1.4.1-3-g733a5