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

Rustfmt breaks static async closure #5149

Closed
dtolnay opened this issue Dec 23, 2021 · 0 comments · Fixed by #5150
Closed

Rustfmt breaks static async closure #5149

dtolnay opened this issue Dec 23, 2021 · 0 comments · Fixed by #5150

Comments

@dtolnay
Copy link
Member

dtolnay commented Dec 23, 2021

#![feature(async_closure)]

macro_rules! expr {
    ($e:expr) => {};
}

expr!(static async || {});

As of current master (7b8303d), cargo run --bin rustfmt -- repro.rs --emit=stdout --edition=2021 creates the following diff:

- expr!(static async || {});
  expr!(async static || {});

which fails to compile:

error: expected one of `move`, `|`, or `||`, found keyword `static`
 --> repro.rs:7:13
  |
4 |     ($e:expr) => {};
  |      ------- while parsing argument for this `expr` macro fragment
...
7 | expr!(async static || {});
  |             ^^^^^^ expected one of `move`, `|`, or `||`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant