]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #91022 - compiler-errors:modulo_infer, r=estebank
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 20 Nov 2021 21:33:51 +0000 (22:33 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Nov 2021 21:33:51 +0000 (22:33 +0100)
Suggest `await` in more situations where infer types are involved

Currently we use `TyS::same_type` in diagnostics that suggest adding `.await` to opaque future types.

This change makes the suggestion slightly more general, when we're comparing types like `Result<T, E>` and `Result<_, _>` which happens sometimes in places like `match` patterns or `let` statements with partially-elaborated types.

----

Question:
1. Is this change worthwhile? Totally fine if it doesn't make sense adding.
2. Should `same_type_modulo_infer` live in `rustc_infer::infer::error_reporting` or alongside the other method in `rustc_middle::ty::util`?
3. Should we generalize this change? I wanted to change all usages, but I don't want erroneous suggestions when adding `.field_name`...


Trivial merge