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

docs: clarify the editions behavior and it's consequences on formatting #6486

Merged
merged 9 commits into from
Feb 27, 2025

Conversation

karolzwolak
Copy link
Contributor

@karolzwolak karolzwolak commented Feb 25, 2025

When using rustfmt directly on a project targeting the 2024 edition, the formatting differs from cargo fmt because rustfmt defaults to the 2015 edition. This discrepancy causes inconsistencies, especially when tools like editors automatically run rustfmt on save, leading to files being reformatted to the 2015 edition style.

I tried to explain this behavior concisely in the docs.
Fixes #6483.

@karolzwolak
Copy link
Contributor Author

Okay, I think I addressed everything, let me know if there is anything else to tweak.

@karolzwolak karolzwolak force-pushed the editions-doc-fix-6483 branch 2 times, most recently from 3085143 to 21852b6 Compare February 26, 2025 20:51
@karolzwolak
Copy link
Contributor Author

I fixed those 2 issues you had and I fast-forwarded the branch.

Copy link
Contributor

@ytmimi ytmimi left a comment

Choose a reason for hiding this comment

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

Thanks so much for the edits. Please see my suggestions for additional updates to the docs.

@karolzwolak karolzwolak force-pushed the editions-doc-fix-6483 branch from 57e11a7 to ecf3b62 Compare February 27, 2025 09:55
@karolzwolak karolzwolak force-pushed the editions-doc-fix-6483 branch from afab171 to 4f89165 Compare February 27, 2025 14:36
@karolzwolak
Copy link
Contributor Author

If you have no further suggestions, should I squash the changes into a single commit?

@ytmimi
Copy link
Contributor

ytmimi commented Feb 27, 2025

If you have no further suggestions, should I squash the changes into a single commit?

If you'd like, but I can squash and merge too if that's easier.

@karolzwolak
Copy link
Contributor Author

I could do it, but I'm not sure on the semantics of the squashed commit (the name and description), so if you can do it, go ahead.

@ytmimi ytmimi merged commit c6c8159 into rust-lang:master Feb 27, 2025
26 checks passed
@karolzwolak karolzwolak deleted the editions-doc-fix-6483 branch February 28, 2025 12:52
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 this pull request may close these issues.

Cargo fmt and rustfmt are using different editions by default
3 participants