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

Add edition to .rustfmt.toml #1663

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Add edition to .rustfmt.toml #1663

merged 1 commit into from
Sep 4, 2024

Conversation

gefjon
Copy link
Contributor

@gefjon gefjon commented Sep 4, 2024

Description of Changes

When invoked standalone (i.e. not through cargo fmt), rustfmt does not respect the edition (or any other configuration) in Cargo.toml, instead relying solely on rustfmt.toml or .rustfmt.toml. My editor automatically invokes rustfmt on individual files on save. Unless rustfmt sees a specified edition, it assumes 2018, and rejects any code that uses async. This is a huge pain.

Specify edition = "2021" in .rustfmt.toml so that standalone rustfmt works.

API and ABI breaking changes

N/a

Expected complexity level and risk

0

Testing

N/a

When invoked standalone (i.e. not through `cargo fmt`), `rustfmt` does not respect the edition (or any other configuration) in `Cargo.toml`, instead relying solely on `rustfmt.toml` or `.rustfmt.toml`. My editor automatically invokes `rustfmt` on individual files on save. Unless `rustfmt` sees a specified edition, it assumes 2018, and rejects any code that uses `async`. This is a huge pain.

Specify `edition = "2021"` in `.rustfmt.toml` so that standalone `rustfmt` works.

Signed-off-by: Phoebe Goldman <phoebe@clockworklabs.io>
@gefjon gefjon added release-any To be landed in any release window no runtime change This change does not affect the final binaries labels Sep 4, 2024
@gefjon gefjon added this pull request to the merge queue Sep 4, 2024
Merged via the queue into master with commit dd65d6d Sep 4, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no runtime change This change does not affect the final binaries release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants