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

Open
Aaron1011 opened this issue Jul 4, 2019 · 1 comment
Open

Invalid suggestion when attempting to call async closure #62386

Aaron1011 opened this issue Jul 4, 2019 · 1 comment

Comments

@Aaron1011
Copy link
Member

@Aaron1011 Aaron1011 commented Jul 4, 2019

The following snippet:

#![feature(async_await)]

fn main() {
    async || ({
    })();
}

produces the following error:

error[E0618]: expected function, found `()`
 --> src/main.rs:4:14
  |
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.

@Centril
Copy link
Contributor

@Centril Centril 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants