]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/parser/diagnostics.rs
Rollup merge of #107085 - tmiasko:custom-mir-operators, r=oli-obk
[rust.git] / compiler / rustc_parse / src / parser / diagnostics.rs
index 07bd76dc39ba9fee87694b885a0ed2ea207c785b..eda7046c748e5f52121854349a3fa6f903e502d2 100644 (file)
@@ -2500,6 +2500,8 @@ pub(crate) fn maybe_recover_colon_colon_in_pat_typo_or_anon_enum(
                     Ok(ty) => {
                         err.span_label(ty.span, "specifying the type of a pattern isn't supported");
                         self.restore_snapshot(snapshot_type);
+                        let new_span = first_pat.span.to(ty.span);
+                        first_pat = self.mk_pat(new_span, PatKind::Wild);
                     }
                 }
                 err.emit();