1
Fork 0

Impove diagnostic for .await-ing non-futures

This commit is contained in:
Lukas Markeffsky 2022-09-12 16:54:25 +02:00
parent 56e7678ca9
commit 2b7fb8d941
6 changed files with 52 additions and 17 deletions

View file

@ -1160,8 +1160,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// and if not maybe suggest doing something else? If we kept the expression around we
// could also check if it is an fn call (very likely) and suggest changing *that*, if
// it is from the local crate.
err.span_suggestion_verbose(
expr.span.shrink_to_hi().with_hi(span.hi()),
err.span_suggestion(
span,
"remove the `.await`",
"",
Applicability::MachineApplicable,