From 845cf93378078327061a443a2f356423b379d114 Mon Sep 17 00:00:00 2001 From: Caleb Cartwright Date: Fri, 19 Jul 2024 18:25:11 -0500 Subject: [PATCH] refactor: switch idempotence/system tests to style_edition Updates all the various files utilized in the system and idempotence tests to directly use the corresponding 'style_edition' configuration as opposed to keeping the original 'version' values and relying on the mapping. --- tests/config/issue-5801-v2.toml | 2 +- tests/source/arrow_in_comments/arrow_in_single_comment.rs | 2 +- tests/source/arrow_in_comments/multiple_arrows.rs | 2 +- .../configs/indent_style/block_trailing_comma_call/one.rs | 2 +- .../configs/indent_style/block_trailing_comma_call/two.rs | 2 +- tests/source/fn-single-line/version_one.rs | 2 +- tests/source/fn-single-line/version_two.rs | 2 +- tests/source/issue-2179/one.rs | 2 +- tests/source/issue-2179/two.rs | 2 +- tests/source/issue-3213/version_one.rs | 2 +- tests/source/issue-3213/version_two.rs | 2 +- tests/source/issue-3227/two.rs | 2 +- tests/source/issue-3270/one.rs | 2 +- tests/source/issue-3270/two.rs | 2 +- tests/source/issue-3272/v1.rs | 2 +- tests/source/issue-3272/v2.rs | 2 +- tests/source/issue-3278/version_one.rs | 2 +- tests/source/issue-3278/version_two.rs | 2 +- tests/source/issue-3295/two.rs | 2 +- tests/source/issue-3302.rs | 2 +- tests/source/issue-3701/one.rs | 2 +- tests/source/issue-3701/two.rs | 2 +- tests/source/issue-3805.rs | 2 +- tests/source/issue-3840/version-two_hard-tabs.rs | 2 +- tests/source/issue-3840/version-two_soft-tabs.rs | 2 +- tests/source/issue-4530.rs | 2 +- tests/source/issue-4689/one.rs | 2 +- tests/source/issue-4689/two.rs | 2 +- tests/source/issue-5586.rs | 2 +- tests/source/issue-5655/one.rs | 2 +- tests/source/issue-5655/two.rs | 2 +- .../issue-5801/comment_unexpectedly_wraps_before_max_width.rs | 2 +- tests/source/issue-5987/two.rs | 2 +- tests/source/issue-6147/case_rustfmt_v1.rs | 2 +- tests/source/issue-6147/case_rustfmt_v2.rs | 2 +- tests/source/issue_5027.rs | 2 +- tests/source/let_else_v2.rs | 2 +- tests/source/long-fn-1/version_one.rs | 2 +- tests/source/long-fn-1/version_two.rs | 2 +- tests/source/one_line_if_v1.rs | 2 +- tests/source/one_line_if_v2.rs | 2 +- tests/source/single-line-macro/v1.rs | 2 +- tests/source/single-line-macro/v2.rs | 2 +- tests/source/trailing_comments/hard_tabs.rs | 2 +- tests/source/trailing_comments/soft_tabs.rs | 2 +- tests/source/tuple_v2.rs | 2 +- tests/target/arrow_in_comments/arrow_in_single_comment.rs | 2 +- tests/target/arrow_in_comments/multiple_arrows.rs | 2 +- tests/target/fn-single-line/version_one.rs | 2 +- tests/target/fn-single-line/version_two.rs | 2 +- tests/target/issue-2179/one.rs | 2 +- tests/target/issue-2179/two.rs | 2 +- tests/target/issue-3132.rs | 2 +- tests/target/issue-3213/version_one.rs | 2 +- tests/target/issue-3213/version_two.rs | 2 +- tests/target/issue-3227/one.rs | 2 +- tests/target/issue-3227/two.rs | 2 +- tests/target/issue-3270/one.rs | 2 +- tests/target/issue-3270/two.rs | 2 +- tests/target/issue-3270/wrap.rs | 2 +- tests/target/issue-3272/v1.rs | 2 +- tests/target/issue-3272/v2.rs | 2 +- tests/target/issue-3278/version_one.rs | 2 +- tests/target/issue-3278/version_two.rs | 2 +- tests/target/issue-3295/two.rs | 2 +- tests/target/issue-3302.rs | 2 +- tests/target/issue-3614/version_one.rs | 2 +- tests/target/issue-3614/version_two.rs | 2 +- tests/target/issue-3701/one.rs | 2 +- tests/target/issue-3701/two.rs | 2 +- tests/target/issue-3805.rs | 2 +- tests/target/issue-3840/version-two_hard-tabs.rs | 2 +- tests/target/issue-3840/version-two_soft-tabs.rs | 2 +- tests/target/issue-3882.rs | 2 +- tests/target/issue-4530.rs | 2 +- tests/target/issue-4689/one.rs | 2 +- tests/target/issue-4689/two.rs | 2 +- tests/target/issue-5586.rs | 2 +- tests/target/issue-5655/one.rs | 2 +- tests/target/issue-5655/two.rs | 2 +- .../target/issue-5801/comment_does_not_wrap_within_max_width.rs | 2 +- .../issue-5801/comment_unexpectedly_wraps_before_max_width.rs | 2 +- tests/target/issue-5987/one.rs | 2 +- tests/target/issue-5987/two.rs | 2 +- tests/target/issue-6147/case_rustfmt_v1.rs | 2 +- tests/target/issue-6147/case_rustfmt_v2.rs | 2 +- tests/target/issue_5027.rs | 2 +- tests/target/let_else_v2.rs | 2 +- tests/target/long-fn-1/version_one.rs | 2 +- tests/target/long-fn-1/version_two.rs | 2 +- tests/target/one_line_if_v1.rs | 2 +- tests/target/one_line_if_v2.rs | 2 +- tests/target/single-line-macro/v1.rs | 2 +- tests/target/single-line-macro/v2.rs | 2 +- tests/target/trailing_comments/hard_tabs.rs | 2 +- tests/target/trailing_comments/soft_tabs.rs | 2 +- tests/target/tuple_v2.rs | 2 +- 97 files changed, 97 insertions(+), 97 deletions(-) diff --git a/tests/config/issue-5801-v2.toml b/tests/config/issue-5801-v2.toml index 948f4fb66bf..98e89d37916 100644 --- a/tests/config/issue-5801-v2.toml +++ b/tests/config/issue-5801-v2.toml @@ -1,3 +1,3 @@ max_width = 120 version = "Two" -attr_fn_like_width = 120 \ No newline at end of file +attr_fn_like_width = 120 diff --git a/tests/source/arrow_in_comments/arrow_in_single_comment.rs b/tests/source/arrow_in_comments/arrow_in_single_comment.rs index fb0576a4822..38e8967e7e6 100644 --- a/tests/source/arrow_in_comments/arrow_in_single_comment.rs +++ b/tests/source/arrow_in_comments/arrow_in_single_comment.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { match a { _ => diff --git a/tests/source/arrow_in_comments/multiple_arrows.rs b/tests/source/arrow_in_comments/multiple_arrows.rs index fc696b309f2..98ef919450f 100644 --- a/tests/source/arrow_in_comments/multiple_arrows.rs +++ b/tests/source/arrow_in_comments/multiple_arrows.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { match a { _ => // comment with => diff --git a/tests/source/configs/indent_style/block_trailing_comma_call/one.rs b/tests/source/configs/indent_style/block_trailing_comma_call/one.rs index 6d48ea742fc..66e2f538415 100644 --- a/tests/source/configs/indent_style/block_trailing_comma_call/one.rs +++ b/tests/source/configs/indent_style/block_trailing_comma_call/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // rustfmt-error_on_line_overflow: false // rustfmt-indent_style: Block diff --git a/tests/source/configs/indent_style/block_trailing_comma_call/two.rs b/tests/source/configs/indent_style/block_trailing_comma_call/two.rs index 7a62d722c6e..51aa6376e23 100644 --- a/tests/source/configs/indent_style/block_trailing_comma_call/two.rs +++ b/tests/source/configs/indent_style/block_trailing_comma_call/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-error_on_line_overflow: false // rustfmt-indent_style: Block diff --git a/tests/source/fn-single-line/version_one.rs b/tests/source/fn-single-line/version_one.rs index 469ab621567..85957e3fdcc 100644 --- a/tests/source/fn-single-line/version_one.rs +++ b/tests/source/fn-single-line/version_one.rs @@ -1,5 +1,5 @@ // rustfmt-fn_single_line: true -// rustfmt-version: One +// rustfmt-style_edition: 2015 // Test single-line functions. fn foo_expr() { diff --git a/tests/source/fn-single-line/version_two.rs b/tests/source/fn-single-line/version_two.rs index bf381ff1065..f119e581217 100644 --- a/tests/source/fn-single-line/version_two.rs +++ b/tests/source/fn-single-line/version_two.rs @@ -1,5 +1,5 @@ // rustfmt-fn_single_line: true -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // Test single-line functions. fn foo_expr() { diff --git a/tests/source/issue-2179/one.rs b/tests/source/issue-2179/one.rs index d23947931ff..8bbd56f0521 100644 --- a/tests/source/issue-2179/one.rs +++ b/tests/source/issue-2179/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // rustfmt-error_on_line_overflow: false fn issue_2179() { diff --git a/tests/source/issue-2179/two.rs b/tests/source/issue-2179/two.rs index f4cc9cc488b..631b0f3c86e 100644 --- a/tests/source/issue-2179/two.rs +++ b/tests/source/issue-2179/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-error_on_line_overflow: false fn issue_2179() { diff --git a/tests/source/issue-3213/version_one.rs b/tests/source/issue-3213/version_one.rs index f9f4cab55e3..ed7d5145150 100644 --- a/tests/source/issue-3213/version_one.rs +++ b/tests/source/issue-3213/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn foo() { match 0 { diff --git a/tests/source/issue-3213/version_two.rs b/tests/source/issue-3213/version_two.rs index 0f068c19d74..c6d04aced8d 100644 --- a/tests/source/issue-3213/version_two.rs +++ b/tests/source/issue-3213/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn foo() { match 0 { diff --git a/tests/source/issue-3227/two.rs b/tests/source/issue-3227/two.rs index c1572c00d57..50c0ad47dc1 100644 --- a/tests/source/issue-3227/two.rs +++ b/tests/source/issue-3227/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { thread::spawn(|| { diff --git a/tests/source/issue-3270/one.rs b/tests/source/issue-3270/one.rs index 3c2e27e2293..64861176b91 100644 --- a/tests/source/issue-3270/one.rs +++ b/tests/source/issue-3270/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 pub fn main() { /* let s = String::from( diff --git a/tests/source/issue-3270/two.rs b/tests/source/issue-3270/two.rs index 0eb756471e7..1342cf03c39 100644 --- a/tests/source/issue-3270/two.rs +++ b/tests/source/issue-3270/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub fn main() { /* let s = String::from( diff --git a/tests/source/issue-3272/v1.rs b/tests/source/issue-3272/v1.rs index f4c1b7c992b..56dc048bf8a 100644 --- a/tests/source/issue-3272/v1.rs +++ b/tests/source/issue-3272/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn main() { assert!(HAYSTACK diff --git a/tests/source/issue-3272/v2.rs b/tests/source/issue-3272/v2.rs index 0148368edc8..f3adbe37c76 100644 --- a/tests/source/issue-3272/v2.rs +++ b/tests/source/issue-3272/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { assert!(HAYSTACK diff --git a/tests/source/issue-3278/version_one.rs b/tests/source/issue-3278/version_one.rs index 580679fbae3..718a32b4c7e 100644 --- a/tests/source/issue-3278/version_one.rs +++ b/tests/source/issue-3278/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 pub fn parse_conditional<'a, I: 'a>( ) -> impl Parser + 'a diff --git a/tests/source/issue-3278/version_two.rs b/tests/source/issue-3278/version_two.rs index c17b1742d39..eb605e509f9 100644 --- a/tests/source/issue-3278/version_two.rs +++ b/tests/source/issue-3278/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub fn parse_conditional<'a, I: 'a>() -> impl Parser + 'a diff --git a/tests/source/issue-3295/two.rs b/tests/source/issue-3295/two.rs index 0eaf022249b..ae3d2ec28c0 100644 --- a/tests/source/issue-3295/two.rs +++ b/tests/source/issue-3295/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub enum TestEnum { a, b, diff --git a/tests/source/issue-3302.rs b/tests/source/issue-3302.rs index c037584fd71..5e0862cb399 100644 --- a/tests/source/issue-3302.rs +++ b/tests/source/issue-3302.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 macro_rules! moo1 { () => { diff --git a/tests/source/issue-3701/one.rs b/tests/source/issue-3701/one.rs index a7f0bd3aa17..4e8518b6f18 100644 --- a/tests/source/issue-3701/one.rs +++ b/tests/source/issue-3701/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/source/issue-3701/two.rs b/tests/source/issue-3701/two.rs index 8e15c58b8b2..d7cb790a754 100644 --- a/tests/source/issue-3701/two.rs +++ b/tests/source/issue-3701/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/source/issue-3805.rs b/tests/source/issue-3805.rs index a0289b57974..aadc4a9dddc 100644 --- a/tests/source/issue-3805.rs +++ b/tests/source/issue-3805.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-format_macro_matchers: true // From original issue example - Line length 101 diff --git a/tests/source/issue-3840/version-two_hard-tabs.rs b/tests/source/issue-3840/version-two_hard-tabs.rs index 7b505fda87c..8d009eabdec 100644 --- a/tests/source/issue-3840/version-two_hard-tabs.rs +++ b/tests/source/issue-3840/version-two_hard-tabs.rs @@ -1,5 +1,5 @@ // rustfmt-hard_tabs: true -// rustfmt-version: Two +// rustfmt-style_edition: 2024 impl + FromEvent, A: Widget2, B: Widget2, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter { diff --git a/tests/source/issue-3840/version-two_soft-tabs.rs b/tests/source/issue-3840/version-two_soft-tabs.rs index 39c8ef31292..9e283d3be0a 100644 --- a/tests/source/issue-3840/version-two_soft-tabs.rs +++ b/tests/source/issue-3840/version-two_soft-tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 impl + FromEvent, A: Widget2, B: Widget2, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter { diff --git a/tests/source/issue-4530.rs b/tests/source/issue-4530.rs index 9d2882abb3c..6b92122f0c0 100644 --- a/tests/source/issue-4530.rs +++ b/tests/source/issue-4530.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { let [aaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccc, ddddddddddddddddddddddddd] = panic!(); } diff --git a/tests/source/issue-4689/one.rs b/tests/source/issue-4689/one.rs index d048eb10fb1..bff090a3525 100644 --- a/tests/source/issue-4689/one.rs +++ b/tests/source/issue-4689/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/source/issue-4689/two.rs b/tests/source/issue-4689/two.rs index ea7feda825d..217535c046e 100644 --- a/tests/source/issue-4689/two.rs +++ b/tests/source/issue-4689/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/source/issue-5586.rs b/tests/source/issue-5586.rs index 9cf6c1d58dd..061ad4bdaa4 100644 --- a/tests/source/issue-5586.rs +++ b/tests/source/issue-5586.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { // sample 1 { diff --git a/tests/source/issue-5655/one.rs b/tests/source/issue-5655/one.rs index 1758ec56f8b..62df2655c29 100644 --- a/tests/source/issue-5655/one.rs +++ b/tests/source/issue-5655/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn foo(_: T) where diff --git a/tests/source/issue-5655/two.rs b/tests/source/issue-5655/two.rs index e37ebbea8af..bfe1d3813bb 100644 --- a/tests/source/issue-5655/two.rs +++ b/tests/source/issue-5655/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn foo(_: T) where diff --git a/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs b/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs index 5847afd9560..e61d34604a1 100644 --- a/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs +++ b/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs @@ -1,7 +1,7 @@ // rustfmt-comment_width: 120 // rustfmt-wrap_comments: true // rustfmt-max_width: 120 -// rustfmt-version: One +// rustfmt-style_edition: 2015 /// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String { diff --git a/tests/source/issue-5987/two.rs b/tests/source/issue-5987/two.rs index e20026b5565..98ed35c4f9a 100644 --- a/tests/source/issue-5987/two.rs +++ b/tests/source/issue-5987/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { trace!( diff --git a/tests/source/issue-6147/case_rustfmt_v1.rs b/tests/source/issue-6147/case_rustfmt_v1.rs index 2ac2e0361c3..bcae86aaff2 100644 --- a/tests/source/issue-6147/case_rustfmt_v1.rs +++ b/tests/source/issue-6147/case_rustfmt_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 pub fn main() { let a = Some(12); diff --git a/tests/source/issue-6147/case_rustfmt_v2.rs b/tests/source/issue-6147/case_rustfmt_v2.rs index c1bf1ad4bf8..da612b213fc 100644 --- a/tests/source/issue-6147/case_rustfmt_v2.rs +++ b/tests/source/issue-6147/case_rustfmt_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub fn main() { let a = Some(12); diff --git a/tests/source/issue_5027.rs b/tests/source/issue_5027.rs index 67beeb23b71..a47d6df6f0f 100644 --- a/tests/source/issue_5027.rs +++ b/tests/source/issue_5027.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub type Iter<'a, D> = impl DoubleEndedIterator)>+ ExactSizeIterator+ 'a; diff --git a/tests/source/let_else_v2.rs b/tests/source/let_else_v2.rs index a420fbcf95b..23be32d629a 100644 --- a/tests/source/let_else_v2.rs +++ b/tests/source/let_else_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-single_line_let_else_max_width: 100 fn issue5901() { diff --git a/tests/source/long-fn-1/version_one.rs b/tests/source/long-fn-1/version_one.rs index d6832c2af09..60083024810 100644 --- a/tests/source/long-fn-1/version_one.rs +++ b/tests/source/long-fn-1/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/source/long-fn-1/version_two.rs b/tests/source/long-fn-1/version_two.rs index f402a26e8b6..bce2c551c6a 100644 --- a/tests/source/long-fn-1/version_two.rs +++ b/tests/source/long-fn-1/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/source/one_line_if_v1.rs b/tests/source/one_line_if_v1.rs index d3dcbe6787a..bf7bc75fb88 100644 --- a/tests/source/one_line_if_v1.rs +++ b/tests/source/one_line_if_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn plain_if(x: bool) -> u8 { if x { diff --git a/tests/source/one_line_if_v2.rs b/tests/source/one_line_if_v2.rs index 40c834959f9..f3c974b12db 100644 --- a/tests/source/one_line_if_v2.rs +++ b/tests/source/one_line_if_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn plain_if(x: bool) -> u8 { if x { diff --git a/tests/source/single-line-macro/v1.rs b/tests/source/single-line-macro/v1.rs index a3aa631ed4a..fea146d8d33 100644 --- a/tests/source/single-line-macro/v1.rs +++ b/tests/source/single-line-macro/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/source/single-line-macro/v2.rs b/tests/source/single-line-macro/v2.rs index 51a665f7560..d9fba64ac70 100644 --- a/tests/source/single-line-macro/v2.rs +++ b/tests/source/single-line-macro/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/source/trailing_comments/hard_tabs.rs b/tests/source/trailing_comments/hard_tabs.rs index 88249aa5fb9..c6d1b3f0ab7 100644 --- a/tests/source/trailing_comments/hard_tabs.rs +++ b/tests/source/trailing_comments/hard_tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-wrap_comments: true // rustfmt-hard_tabs: true diff --git a/tests/source/trailing_comments/soft_tabs.rs b/tests/source/trailing_comments/soft_tabs.rs index 7845f713b8a..431875989f3 100644 --- a/tests/source/trailing_comments/soft_tabs.rs +++ b/tests/source/trailing_comments/soft_tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-wrap_comments: true pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast diff --git a/tests/source/tuple_v2.rs b/tests/source/tuple_v2.rs index 9223033832b..6dc18e00d7e 100644 --- a/tests/source/tuple_v2.rs +++ b/tests/source/tuple_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn issue_4355() { let _ = ((1,),).0 .0; diff --git a/tests/target/arrow_in_comments/arrow_in_single_comment.rs b/tests/target/arrow_in_comments/arrow_in_single_comment.rs index deffdbeeaaf..d638a6b4ef0 100644 --- a/tests/target/arrow_in_comments/arrow_in_single_comment.rs +++ b/tests/target/arrow_in_comments/arrow_in_single_comment.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { match a { _ => diff --git a/tests/target/arrow_in_comments/multiple_arrows.rs b/tests/target/arrow_in_comments/multiple_arrows.rs index b0443411816..f6f4a60eec3 100644 --- a/tests/target/arrow_in_comments/multiple_arrows.rs +++ b/tests/target/arrow_in_comments/multiple_arrows.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { match a { _ => diff --git a/tests/target/fn-single-line/version_one.rs b/tests/target/fn-single-line/version_one.rs index 013b2cd7216..5b704474d6d 100644 --- a/tests/target/fn-single-line/version_one.rs +++ b/tests/target/fn-single-line/version_one.rs @@ -1,5 +1,5 @@ // rustfmt-fn_single_line: true -// rustfmt-version: One +// rustfmt-style_edition: 2015 // Test single-line functions. fn foo_expr() { 1 } diff --git a/tests/target/fn-single-line/version_two.rs b/tests/target/fn-single-line/version_two.rs index b8053d4c2f5..aedd1d481b6 100644 --- a/tests/target/fn-single-line/version_two.rs +++ b/tests/target/fn-single-line/version_two.rs @@ -1,5 +1,5 @@ // rustfmt-fn_single_line: true -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // Test single-line functions. fn foo_expr() { 1 } diff --git a/tests/target/issue-2179/one.rs b/tests/target/issue-2179/one.rs index 3f98acc8dcd..6593624e589 100644 --- a/tests/target/issue-2179/one.rs +++ b/tests/target/issue-2179/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // rustfmt-error_on_line_overflow: false fn issue_2179() { diff --git a/tests/target/issue-2179/two.rs b/tests/target/issue-2179/two.rs index 96531509ea2..088518705fe 100644 --- a/tests/target/issue-2179/two.rs +++ b/tests/target/issue-2179/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-error_on_line_overflow: false fn issue_2179() { diff --git a/tests/target/issue-3132.rs b/tests/target/issue-3132.rs index 4dffe0ab836..4d61baa7507 100644 --- a/tests/target/issue-3132.rs +++ b/tests/target/issue-3132.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn test() { /* diff --git a/tests/target/issue-3213/version_one.rs b/tests/target/issue-3213/version_one.rs index 307903b128b..a20915df761 100644 --- a/tests/target/issue-3213/version_one.rs +++ b/tests/target/issue-3213/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn foo() { match 0 { diff --git a/tests/target/issue-3213/version_two.rs b/tests/target/issue-3213/version_two.rs index de93d04ba95..fb609f6a67a 100644 --- a/tests/target/issue-3213/version_two.rs +++ b/tests/target/issue-3213/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn foo() { match 0 { diff --git a/tests/target/issue-3227/one.rs b/tests/target/issue-3227/one.rs index fcc8331000d..2922bfdfef7 100644 --- a/tests/target/issue-3227/one.rs +++ b/tests/target/issue-3227/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn main() { thread::spawn(|| { diff --git a/tests/target/issue-3227/two.rs b/tests/target/issue-3227/two.rs index 374ab54305d..ae7eee47194 100644 --- a/tests/target/issue-3227/two.rs +++ b/tests/target/issue-3227/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { thread::spawn(|| { diff --git a/tests/target/issue-3270/one.rs b/tests/target/issue-3270/one.rs index 78de9473243..a31a0ff5742 100644 --- a/tests/target/issue-3270/one.rs +++ b/tests/target/issue-3270/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 pub fn main() { /* let s = String::from( diff --git a/tests/target/issue-3270/two.rs b/tests/target/issue-3270/two.rs index e48b5921329..8e26f8ac23d 100644 --- a/tests/target/issue-3270/two.rs +++ b/tests/target/issue-3270/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub fn main() { /* let s = String::from( diff --git a/tests/target/issue-3270/wrap.rs b/tests/target/issue-3270/wrap.rs index 7435c5f0866..967bfb5534c 100644 --- a/tests/target/issue-3270/wrap.rs +++ b/tests/target/issue-3270/wrap.rs @@ -1,5 +1,5 @@ // rustfmt-wrap_comments: true -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // check that a line below max_width does not get over the limit when wrapping // it in a block comment diff --git a/tests/target/issue-3272/v1.rs b/tests/target/issue-3272/v1.rs index aab201027d5..7cca7ea7896 100644 --- a/tests/target/issue-3272/v1.rs +++ b/tests/target/issue-3272/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn main() { assert!(HAYSTACK diff --git a/tests/target/issue-3272/v2.rs b/tests/target/issue-3272/v2.rs index a42a2fccd5b..ca7718c5a61 100644 --- a/tests/target/issue-3272/v2.rs +++ b/tests/target/issue-3272/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { assert!( diff --git a/tests/target/issue-3278/version_one.rs b/tests/target/issue-3278/version_one.rs index 580679fbae3..718a32b4c7e 100644 --- a/tests/target/issue-3278/version_one.rs +++ b/tests/target/issue-3278/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 pub fn parse_conditional<'a, I: 'a>( ) -> impl Parser + 'a diff --git a/tests/target/issue-3278/version_two.rs b/tests/target/issue-3278/version_two.rs index c17b1742d39..eb605e509f9 100644 --- a/tests/target/issue-3278/version_two.rs +++ b/tests/target/issue-3278/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub fn parse_conditional<'a, I: 'a>() -> impl Parser + 'a diff --git a/tests/target/issue-3295/two.rs b/tests/target/issue-3295/two.rs index 3e669a0bb75..4f685172cfa 100644 --- a/tests/target/issue-3295/two.rs +++ b/tests/target/issue-3295/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub enum TestEnum { a, b, diff --git a/tests/target/issue-3302.rs b/tests/target/issue-3302.rs index 146cb983819..504bfd987f5 100644 --- a/tests/target/issue-3302.rs +++ b/tests/target/issue-3302.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 macro_rules! moo1 { () => { diff --git a/tests/target/issue-3614/version_one.rs b/tests/target/issue-3614/version_one.rs index 8ab28304732..4bd972aa87a 100644 --- a/tests/target/issue-3614/version_one.rs +++ b/tests/target/issue-3614/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn main() { let toto = || { diff --git a/tests/target/issue-3614/version_two.rs b/tests/target/issue-3614/version_two.rs index 5d6f8e7a313..7b9534caa02 100644 --- a/tests/target/issue-3614/version_two.rs +++ b/tests/target/issue-3614/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { let toto = || { diff --git a/tests/target/issue-3701/one.rs b/tests/target/issue-3701/one.rs index 9d1ef9eed9a..b154724d341 100644 --- a/tests/target/issue-3701/one.rs +++ b/tests/target/issue-3701/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/target/issue-3701/two.rs b/tests/target/issue-3701/two.rs index 62ffc9d823d..995763ef291 100644 --- a/tests/target/issue-3701/two.rs +++ b/tests/target/issue-3701/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/target/issue-3805.rs b/tests/target/issue-3805.rs index a247a43fe6d..a1eda832d76 100644 --- a/tests/target/issue-3805.rs +++ b/tests/target/issue-3805.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-format_macro_matchers: true // From original issue example - Line length 101 diff --git a/tests/target/issue-3840/version-two_hard-tabs.rs b/tests/target/issue-3840/version-two_hard-tabs.rs index 084db3d1465..78a2f921735 100644 --- a/tests/target/issue-3840/version-two_hard-tabs.rs +++ b/tests/target/issue-3840/version-two_hard-tabs.rs @@ -1,5 +1,5 @@ // rustfmt-hard_tabs: true -// rustfmt-version: Two +// rustfmt-style_edition: 2024 impl< Target: FromEvent + FromEvent, diff --git a/tests/target/issue-3840/version-two_soft-tabs.rs b/tests/target/issue-3840/version-two_soft-tabs.rs index bc59b0baa56..c76dd4dafbb 100644 --- a/tests/target/issue-3840/version-two_soft-tabs.rs +++ b/tests/target/issue-3840/version-two_soft-tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 impl< Target: FromEvent + FromEvent, diff --git a/tests/target/issue-3882.rs b/tests/target/issue-3882.rs index 5eb442af974..8e617635b7c 100644 --- a/tests/target/issue-3882.rs +++ b/tests/target/issue-3882.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn bar(_t: T, // bar ) { } diff --git a/tests/target/issue-4530.rs b/tests/target/issue-4530.rs index 296dc559a93..9e9fbf95c2d 100644 --- a/tests/target/issue-4530.rs +++ b/tests/target/issue-4530.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { let [ aaaaaaaaaaaaaaaaaaaaaaaaaa, diff --git a/tests/target/issue-4689/one.rs b/tests/target/issue-4689/one.rs index 7735e34f3b5..fb523f38501 100644 --- a/tests/target/issue-4689/one.rs +++ b/tests/target/issue-4689/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/target/issue-4689/two.rs b/tests/target/issue-4689/two.rs index e3b5cd22810..30303490129 100644 --- a/tests/target/issue-4689/two.rs +++ b/tests/target/issue-4689/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/target/issue-5586.rs b/tests/target/issue-5586.rs index 7033ae975b3..afe13d1fb1c 100644 --- a/tests/target/issue-5586.rs +++ b/tests/target/issue-5586.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { // sample 1 { diff --git a/tests/target/issue-5655/one.rs b/tests/target/issue-5655/one.rs index 1758ec56f8b..62df2655c29 100644 --- a/tests/target/issue-5655/one.rs +++ b/tests/target/issue-5655/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn foo(_: T) where diff --git a/tests/target/issue-5655/two.rs b/tests/target/issue-5655/two.rs index 14fbc3d1321..4a7eb4f4bc2 100644 --- a/tests/target/issue-5655/two.rs +++ b/tests/target/issue-5655/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn foo(_: T) where diff --git a/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs b/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs index 9f294751108..461b5873a68 100644 --- a/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs +++ b/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs @@ -1,7 +1,7 @@ // rustfmt-comment_width: 120 // rustfmt-wrap_comments: true // rustfmt-max_width: 120 -// rustfmt-version: Two +// rustfmt-style_edition: 2024 /// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String { diff --git a/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs b/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs index dd839dd4548..58bb8a1c2e3 100644 --- a/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs +++ b/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs @@ -1,7 +1,7 @@ // rustfmt-comment_width: 120 // rustfmt-wrap_comments: true // rustfmt-max_width: 120 -// rustfmt-version: One +// rustfmt-style_edition: 2015 /// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String { diff --git a/tests/target/issue-5987/one.rs b/tests/target/issue-5987/one.rs index 3c995ed28ba..17327feead5 100644 --- a/tests/target/issue-5987/one.rs +++ b/tests/target/issue-5987/one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn main() { trace!( diff --git a/tests/target/issue-5987/two.rs b/tests/target/issue-5987/two.rs index 8fd92fc179e..41ecb13e3db 100644 --- a/tests/target/issue-5987/two.rs +++ b/tests/target/issue-5987/two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn main() { trace!( diff --git a/tests/target/issue-6147/case_rustfmt_v1.rs b/tests/target/issue-6147/case_rustfmt_v1.rs index 75800012c63..d8e67655e4c 100644 --- a/tests/target/issue-6147/case_rustfmt_v1.rs +++ b/tests/target/issue-6147/case_rustfmt_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 pub fn main() { let a = Some(12); diff --git a/tests/target/issue-6147/case_rustfmt_v2.rs b/tests/target/issue-6147/case_rustfmt_v2.rs index 5e4220e7306..9d0b12d686b 100644 --- a/tests/target/issue-6147/case_rustfmt_v2.rs +++ b/tests/target/issue-6147/case_rustfmt_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub fn main() { let a = Some(12); diff --git a/tests/target/issue_5027.rs b/tests/target/issue_5027.rs index 26d771720b6..1de3e0d4f15 100644 --- a/tests/target/issue_5027.rs +++ b/tests/target/issue_5027.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 pub type Iter<'a, D> = impl DoubleEndedIterator)> + ExactSizeIterator diff --git a/tests/target/let_else_v2.rs b/tests/target/let_else_v2.rs index b25ac1609d8..6e886299cb0 100644 --- a/tests/target/let_else_v2.rs +++ b/tests/target/let_else_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-single_line_let_else_max_width: 100 fn issue5901() { diff --git a/tests/target/long-fn-1/version_one.rs b/tests/target/long-fn-1/version_one.rs index 05f69953c26..60f672c1837 100644 --- a/tests/target/long-fn-1/version_one.rs +++ b/tests/target/long-fn-1/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/target/long-fn-1/version_two.rs b/tests/target/long-fn-1/version_two.rs index 32794bccde2..f6007398bcc 100644 --- a/tests/target/long-fn-1/version_two.rs +++ b/tests/target/long-fn-1/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/target/one_line_if_v1.rs b/tests/target/one_line_if_v1.rs index b3c6c4cbeb2..5160ea0264c 100644 --- a/tests/target/one_line_if_v1.rs +++ b/tests/target/one_line_if_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 fn plain_if(x: bool) -> u8 { if x { diff --git a/tests/target/one_line_if_v2.rs b/tests/target/one_line_if_v2.rs index 81ca4c8b8b4..a9610ec9749 100644 --- a/tests/target/one_line_if_v2.rs +++ b/tests/target/one_line_if_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn plain_if(x: bool) -> u8 { if x { 0 } else { 1 } diff --git a/tests/target/single-line-macro/v1.rs b/tests/target/single-line-macro/v1.rs index a3aa631ed4a..fea146d8d33 100644 --- a/tests/target/single-line-macro/v1.rs +++ b/tests/target/single-line-macro/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-version: One +// rustfmt-style_edition: 2015 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/target/single-line-macro/v2.rs b/tests/target/single-line-macro/v2.rs index 9c6bcf33ad5..6fcacb70ba3 100644 --- a/tests/target/single-line-macro/v2.rs +++ b/tests/target/single-line-macro/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/target/trailing_comments/hard_tabs.rs b/tests/target/trailing_comments/hard_tabs.rs index 35e72f1affd..e7009ac00c0 100644 --- a/tests/target/trailing_comments/hard_tabs.rs +++ b/tests/target/trailing_comments/hard_tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-wrap_comments: true // rustfmt-hard_tabs: true diff --git a/tests/target/trailing_comments/soft_tabs.rs b/tests/target/trailing_comments/soft_tabs.rs index eba943042ad..34cfed1a229 100644 --- a/tests/target/trailing_comments/soft_tabs.rs +++ b/tests/target/trailing_comments/soft_tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 // rustfmt-wrap_comments: true pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast diff --git a/tests/target/tuple_v2.rs b/tests/target/tuple_v2.rs index ba653291c2f..fa508332be5 100644 --- a/tests/target/tuple_v2.rs +++ b/tests/target/tuple_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +// rustfmt-style_edition: 2024 fn issue_4355() { let _ = ((1,),).0.0;