diff options
| author | Lukas Markeffsky <@> | 2023-03-25 22:27:24 +0100 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2023-03-25 22:27:24 +0100 |
| commit | 08f3deb3d5a2164d8a601d37c87f2453b2f09eed (patch) | |
| tree | c11ae8b76ce17360276c041e7707e47bbed846ab /compiler | |
| parent | b72e896268bd741a2a2bb10028dca9e6f8d0ae63 (diff) | |
| download | rust-08f3deb3d5a2164d8a601d37c87f2453b2f09eed.tar.gz rust-08f3deb3d5a2164d8a601d37c87f2453b2f09eed.zip | |
fix type suggestions in match arms
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_infer/src/infer/error_reporting/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index fd16363a1db..75c3d9f641d 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -1942,7 +1942,8 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { escaped } let mut err = struct_span_err!(self.tcx.sess, span, E0308, "{}", failure_str); - 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 |
