From 3fb6d6b2f422943cea592f64e4ae8984d6b86f1f Mon Sep 17 00:00:00 2001 From: IQuant Date: Tue, 4 Apr 2023 19:18:34 +0300 Subject: [PATCH] Now passes tests --- compiler/rustc_infer/src/infer/error_reporting/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index ca4f1c20b892..34dfcea81d18 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -1928,7 +1928,8 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { use crate::traits::ObligationCauseCode::MatchExpressionArm; let mut suggestions = Vec::new(); let span = trace.cause.span(); - if let Some((expected, found)) = trace.values.ty() { + let values = self.resolve_vars_if_possible(trace.values); + if let Some((expected, found)) = values.ty() { match (expected.kind(), found.kind()) { (ty::Tuple(_), ty::Tuple(_)) => {} // If a tuple of length one was expected and the found expression has