diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-15 01:28:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-15 01:28:04 +0100 |
| commit | b166642c353ea19c02c4bdb7494c1c2f19868ad4 (patch) | |
| tree | ba3317f58cb5b376c1ee142f8ed0c7cf390cf5dd /clippy_lints/src/methods/str_splitn.rs | |
| parent | 6b6cc5d5764e83a122f24d966a59a60cee871633 (diff) | |
| parent | c5287b37fa048e83374afa274168f184a4479013 (diff) | |
Rollup merge of #90939 - estebank:wg-af-polish, r=tmandry
Tweak errors coming from `for`-loop, `?` and `.await` desugaring
* Suggest removal of `.await` on non-`Future` expression
* Keep track of obligations introduced by desugaring
* Remove span pointing at method for obligation errors coming from desugaring
* Point at called local sync `fn` and suggest making it `async`
```
error[E0277]: `()` is not a future
--> $DIR/unnecessary-await.rs:9:10
|
LL | boo().await;
| -----^^^^^^ `()` is not a future
| |
| this call returns `()`
|
= help: the trait `Future` is not implemented for `()`
help: do not `.await` the expression
|
LL - boo().await;
LL + boo();
|
help: alternatively, consider making `fn boo` asynchronous
|
LL | async fn boo () {}
| +++++
```
Fix #66731.
Diffstat (limited to 'clippy_lints/src/methods/str_splitn.rs')
| -rw-r--r-- | clippy_lints/src/methods/str_splitn.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/methods/str_splitn.rs b/clippy_lints/src/methods/str_splitn.rs index 2595f734f11..e5fafdb075c 100644 --- a/clippy_lints/src/methods/str_splitn.rs +++ b/clippy_lints/src/methods/str_splitn.rs @@ -204,7 +204,7 @@ fn parse_iter_usage( match e.kind { ExprKind::Call( Expr { - kind: ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, _)), + kind: ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, ..)), .. }, _, |
