about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorJules Bertholet <julesbertholet@quoi.xyz>2024-03-26 01:23:26 -0400
committerJules Bertholet <julesbertholet@quoi.xyz>2024-03-27 11:20:28 -0400
commit528d45af18b90ec9833568420a34d4e6050b1ec6 (patch)
treef30ed390e50c509fc99045569f021a5b71da7583 /compiler/rustc_parse/src/parser
parente0da13f25fd223ee1ec20284ea3f4e88a818b804 (diff)
downloadrust-528d45af18b90ec9833568420a34d4e6050b1ec6.tar.gz
rust-528d45af18b90ec9833568420a34d4e6050b1ec6.zip
Feature gate
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/pat.rs4
1 files changed, 4 insertions, 0 deletions
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)
     }