Impove diagnostic for .await-ing non-futures
This commit is contained in:
parent
56e7678ca9
commit
2b7fb8d941
6 changed files with 52 additions and 17 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue