don't suggest awaiting type expr patterns
This commit is contained in:
parent
d371d17496
commit
26677eb06e
3 changed files with 24 additions and 3 deletions
|
@ -71,4 +71,11 @@ async fn suggest_await_in_generic_pattern() {
|
|||
}
|
||||
}
|
||||
|
||||
// Issue #126903
|
||||
async fn do_async() {}
|
||||
fn dont_suggest_awaiting_closure_patterns() {
|
||||
Some(do_async()).map(|()| {});
|
||||
//~^ ERROR mismatched types [E0308]
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -133,6 +133,18 @@ help: consider `await`ing on the `Future`
|
|||
LL | match dummy_result().await {
|
||||
| ++++++
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/suggest-missing-await.rs:77:27
|
||||
|
|
||||
LL | Some(do_async()).map(|()| {});
|
||||
| ^^
|
||||
| |
|
||||
| expected future, found `()`
|
||||
| expected due to this
|
||||
|
|
||||
= note: expected opaque type `impl Future<Output = ()>`
|
||||
found unit type `()`
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue