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. |
calebcartwright
left a comment
There was a problem hiding this comment.
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; | |||
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
== Edition2018to>= Edition2018. (And adds aPartialOrdimplementation toEditionto make that possible.)