]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/parser/diagnostics.rs
Auto merge of #107267 - cjgillot:keep-aggregate, r=oli-obk
[rust.git] / compiler / rustc_parse / src / parser / diagnostics.rs
index 26274822ed8a8ffdeef508586b7c91f471764156..cd9d85b1d919c9c3f45541e83a9223857550be9c 100644 (file)
@@ -2394,7 +2394,7 @@ pub fn dummy_const_arg_needs_braces(
 
     /// Some special error handling for the "top-level" patterns in a match arm,
     /// `for` loop, `let`, &c. (in contrast to subpatterns within such).
-    pub(crate) fn maybe_recover_colon_colon_in_pat_typo_or_anon_enum(
+    pub(crate) fn maybe_recover_colon_colon_in_pat_typo(
         &mut self,
         mut first_pat: P<Pat>,
         expected: Option<Expected>,
@@ -2435,8 +2435,9 @@ pub(crate) fn maybe_recover_colon_colon_in_pat_typo_or_anon_enum(
         // Create error for "unexpected `:`".
         match self.expected_one_of_not_found(&[], &[]) {
             Err(mut err) => {
-                snapshot_pat.bump(); // Skip the `:`.
-                snapshot_type.bump(); // Skip the `:`.
+                // Skip the `:`.
+                snapshot_pat.bump();
+                snapshot_type.bump();
                 match snapshot_pat.parse_pat_no_top_alt(expected) {
                     Err(inner_err) => {
                         inner_err.cancel();