]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/pat.rs
Rollup merge of #106499 - lyming2007:issue-105946-fix, r=estebank
[rust.git] / compiler / rustc_hir_typeck / src / pat.rs
index 0143901f2d7a734b910815f5c56bcb7bff040e43..e0304fa2d3b98b017f04ca6927c86e06d40639d7 100644 (file)
@@ -553,6 +553,9 @@ fn emit_err_pat_range(
             (lhs, Some((true, rhs_ty, rhs_sp))) => one_side_err(rhs_sp, rhs_ty, lhs),
             _ => span_bug!(span, "Impossible, verified above."),
         }
+        if (lhs, rhs).references_error() {
+            err.downgrade_to_delayed_bug();
+        }
         if self.tcx.sess.teach(&err.get_code().unwrap()) {
             err.note(
                 "In a match expression, only numbers and characters can be matched \