-
Notifications
You must be signed in to change notification settings - Fork 888
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 support for edition 2021. #4618
Conversation
Thanks for this, we've triggered an early publish of the rustc-ap* crates so v697 is now available, and we should be able to proceed a bit earlier than Tue |
Updated. This now fails on a change in how rustfmt formats macro arguments: -macro foo($type_name: ident, $docs: expr) {
+macro foo($type_name:ident, $docs:expr) { Trying to find out which rustc change caused this. Edit: This changed between rustc-ap 693 and 694. Edit 2: |
Looks like this is a bug that is now fixed by that change. Before that change, |
Ah, the problem was that rustfmt skipped formatting of the entire macro definition because of I'll update the expected test output, as this seems simply a bug that is now fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, thank you! Would you mind adding a test that has the Edition set to 2021?
Something as simple as adding a single file (perhaps tests/target/imports_2021_edition.rs
) with a snippet like the one below would suffice
// rustfmt-edition: 2021
use ::foo::Bar;
Done! |
@@ -0,0 +1,3 @@ | |||
// rustfmt-edition: 2021 | |||
|
|||
use ::happy::new::year; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆 love it
This was added to Configurations.md in #4618, but the option wasn't actually made available. This should let people who are using Rust 2021 on nightly rustc run `cargo fmt` again.
This was added to Configurations.md in rust-lang#4618, but the option wasn't actually made available. This should let people who are using Rust 2021 on nightly rustc run `cargo fmt` again.
This was added to Configurations.md in rust-lang#4618, but the option wasn't actually made available. This should let people who are using Rust 2021 on nightly rustc run `cargo fmt` again.
This was added to Configurations.md in rust-lang#4618, but the option wasn't actually made available. This should let people who are using Rust 2021 on nightly rustc run `cargo fmt` again.
This was added to Configurations.md in #4618, but the option wasn't actually made available. This should let people who are using Rust 2021 on nightly rustc run `cargo fmt` again.
Backported in #4623 |
This adds initial support for Rust 2021, by making it behave the same as Rust 2018. It simply changes
== Edition2018
to>= Edition2018
. (And adds aPartialOrd
implementation toEdition
to make that possible.)