Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid suggestion when attempting to call async closure #62386

Aaron1011 opened this issue Jul 4, 2019 · 1 comment


None yet
3 participants
Copy link

commented Jul 4, 2019

The following snippet:


fn main() {
    async || ({

produces the following error:

error[E0618]: expected function, found `()`
 --> src/
4 |        async || ({
  |   ______________^
  |  |______________|
  | ||
5 | ||     })();
  | ||______^_- call expression requires function
  | |_______|
help: if you meant to create this closure and immediately call it, surround the closure with parenthesis
4 |     async || (({
5 |     }))();

However, applying this suggestion doesn't actually fix the error. Instead, it simply causes a new suggestion to be produced - this time with three parentheses (e.g. ((() instead of two.


This comment has been minimized.

Copy link

commented Jul 5, 2019

Labeling as deferred since async closures are not getting stabilized in the MVP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.