Skip to content

Fix static async closure qualifier order #5150

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Dec 24, 2021

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Dec 23, 2021

Fixes #5149.

Previously rustfmt would produce async static || ... which is not valid syntax. The ordering that rustc accepts is static async || ....

Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the report and fix.

I'm a bit surprised by the presence of this issue given the age of the corresponding code (though admittedly never had a use case where I personally needed this so not sure how prevalent it may be). Do you know if something has happened to change upstream or have we just been sitting on a ~4 year old bug?

@calebcartwright calebcartwright merged commit 0b2fd9b into rust-lang:master Dec 24, 2021
@dtolnay dtolnay deleted the staticasync branch December 24, 2021 05:24
@dtolnay
Copy link
Member Author

dtolnay commented Dec 24, 2021

I don't know of anything changing recently. I just hit this while writing pretty printer tests in rust-lang/rust#92238. Rustfmt was mangling the tests: https://github.com/rust-lang/rust/blob/55fc986be72c0db77b65b0198ed5b26ac918ddad/src/test/ui/macros/stringify.rs#L216-L225.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rustfmt breaks static async closure
2 participants