From a310dfb4e304c74456501438dc4f68eb64df583e Mon Sep 17 00:00:00 2001 From: Esteban Kuber Date: Fri, 10 Dec 2021 03:01:37 +0000 Subject: [PATCH] review comment: change wording of suggestion --- .../src/traits/error_reporting/suggestions.rs | 2 +- src/test/ui/async-await/issue-70594.stderr | 2 +- src/test/ui/async-await/issues/issue-62009-1.stderr | 2 +- src/test/ui/async-await/unnecessary-await.stderr | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 1a00b2f3cf713..d1b436ceb8542 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -896,7 +896,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { // it is from the local crate. err.span_suggestion_verbose( expr.span.shrink_to_hi().with_hi(span.hi()), - "do not `.await` the expression", + "remove the `.await`", String::new(), Applicability::MachineApplicable, ); diff --git a/src/test/ui/async-await/issue-70594.stderr b/src/test/ui/async-await/issue-70594.stderr index 405709286822a..a159edd51187f 100644 --- a/src/test/ui/async-await/issue-70594.stderr +++ b/src/test/ui/async-await/issue-70594.stderr @@ -27,7 +27,7 @@ LL | [1; ().await]; = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required because of the requirements on the impl of `IntoFuture` for `()` -help: do not `.await` the expression +help: remove the `.await` | LL - [1; ().await]; LL + [1; ()]; diff --git a/src/test/ui/async-await/issues/issue-62009-1.stderr b/src/test/ui/async-await/issues/issue-62009-1.stderr index 3ea5dac76d4c5..3d80c34942c1b 100644 --- a/src/test/ui/async-await/issues/issue-62009-1.stderr +++ b/src/test/ui/async-await/issues/issue-62009-1.stderr @@ -33,7 +33,7 @@ LL | (|_| 2333).await; = help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` = note: [closure@$DIR/issue-62009-1.rs:12:5: 12:15] must be a future or must implement `IntoFuture` to be awaited = note: required because of the requirements on the impl of `IntoFuture` for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` -help: do not `.await` the expression +help: remove the `.await` | LL - (|_| 2333).await; LL + (|_| 2333); diff --git a/src/test/ui/async-await/unnecessary-await.stderr b/src/test/ui/async-await/unnecessary-await.stderr index 23dea2d3a0c74..c3d2a6e7b1e1b 100644 --- a/src/test/ui/async-await/unnecessary-await.stderr +++ b/src/test/ui/async-await/unnecessary-await.stderr @@ -9,7 +9,7 @@ LL | boo().await; = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required because of the requirements on the impl of `IntoFuture` for `()` -help: do not `.await` the expression +help: remove the `.await` | LL - boo().await; LL + boo();