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

Format async trait bounds in rustfmt #121035

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

compiler-errors
Copy link
Member

r? @ytmimi or @calebcartwright

This PR opts to do formatting in the rust-lang/rust tree because otherwise we'd have to wait until a full sync, and rustfmt is currently totally removing the async keyword.

cc rust-lang/rustfmt#6070

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 13, 2024
@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2024

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@ytmimi
Copy link
Contributor

ytmimi commented Feb 13, 2024

@compiler-errors thanks for putting a PR together so quickly. rust-lang/rustfmt#6070 mentioned that the issue was related to experimental syntax. Is this also impacting stable syntax? I don't see a feature attribute in the test case.

@compiler-errors
Copy link
Member Author

@ytmimi: Does rustfmt even check feature gating?

@ytmimi
Copy link
Contributor

ytmimi commented Feb 13, 2024

@ytmimi: Does rustfmt even check feature gating?

Is that something that rustfmt could check? I wouldn't expect that information to be available in the AST.

@compiler-errors
Copy link
Member Author

compiler-errors commented Feb 13, 2024

@ytmimi: I'm just confused what you're asking for. I didn't include a #![feature(async_closure)] gate in the test because it's not necessary for rustfmt. This does not affect stable syntax.

@ytmimi
Copy link
Contributor

ytmimi commented Feb 13, 2024

@compiler-errors sorry, I was confused when I didn't see #![feature(async_closure)] or any of the features mentioned in rust-lang/rustfmt#6070, and I assumed that this was a more serious issue that was impacting newly stabilized syntax that I didn't know about.

Even if it's unnecessary for rustfmt, I think it would be valuable to include the required features directly in the test case so that it's clearer that this is for a new feature.

@calebcartwright
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 13, 2024

📌 Commit 73536ca has been approved by calebcartwright

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 13, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2024
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#120893 (Move some tests)
 - rust-lang#120966 (Remove importing suggestions when there is a shadowed typo candidate)
 - rust-lang#121035 (Format `async` trait bounds in rustfmt)
 - rust-lang#121075 (Fix false positive with if let and ranges)
 - rust-lang#121083 (Extend documentation for `Ty::to_opt_closure_kind` method)
 - rust-lang#121084 (Make sure `tcx.create_def` also depends on the forever red node, instead of just `tcx.at(span).create_def`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dd4851b into rust-lang:master Feb 14, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2024
Rollup merge of rust-lang#121035 - compiler-errors:rustfmt-asyncness, r=calebcartwright

Format `async` trait bounds in rustfmt

r? `@ytmimi` or `@calebcartwright`

This PR opts to do formatting in the rust-lang/rust tree because otherwise we'd have to wait until a full sync, and rustfmt is currently totally removing the `async` keyword.

cc rust-lang/rustfmt#6070
@RalfJung RalfJung mentioned this pull request Feb 14, 2024
bors added a commit to rust-lang/miri that referenced this pull request Feb 14, 2024
Rustup

With rust-lang/rust#121035 landed we can rustfmt format `async FnOnce`.
bors added a commit to rust-lang/miri that referenced this pull request Feb 14, 2024
Rustup

With rust-lang/rust#121035 landed we can rustfmt format `async FnOnce`.
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Feb 17, 2024
Rustup

With rust-lang#121035 landed we can rustfmt format `async FnOnce`.
calebcartwright pushed a commit to calebcartwright/rust that referenced this pull request Jun 22, 2024
… r=calebcartwright

Format `async` trait bounds in rustfmt

r? `@ytmimi` or `@calebcartwright`

This PR opts to do formatting in the rust-lang/rust tree because otherwise we'd have to wait until a full sync, and rustfmt is currently totally removing the `async` keyword.

cc rust-lang/rustfmt#6070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants