6
Tweak errors coming from `for`-loop, `?` and `.await` desugaring by estebank · P...
source link: https://github.com/rust-lang/rust/pull/90939
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
- 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 itasync
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.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK