]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/_match.rs
Rollup merge of #107487 - edward-shen:edward-shen/107213-round-2, r=estebank
[rust.git] / compiler / rustc_middle / src / ty / _match.rs
index cd147d7e55813d5b4aaec1ab09461a4fd6405abd..b9c5a4e0d0d49b2cb028ea937c0cd79fa3d46dfb 100644 (file)
@@ -89,7 +89,9 @@ fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
                 Err(TypeError::Sorts(relate::expected_found(self, a, b)))
             }
 
-            (&ty::Error(_), _) | (_, &ty::Error(_)) => Ok(self.tcx().ty_error()),
+            (&ty::Error(guar), _) | (_, &ty::Error(guar)) => {
+                Ok(self.tcx().ty_error_with_guaranteed(guar))
+            }
 
             _ => relate::super_relate_tys(self, a, b),
         }