1
Fork 0

Rollup merge of #109613 - lukas-code:match-str-to-char-suggestion, r=compiler-errors

fix type suggestions in match arms

fix https://github.com/rust-lang/rust/issues/109586
This commit is contained in:
Matthias Krüger 2023-03-27 08:46:53 +02:00 committed by GitHub
commit 04b8523c46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 2 deletions

View file

@ -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