Skip to content

Commit

Permalink
refactor: switch idempotence/system tests to style_edition
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
calebcartwright committed Jul 19, 2024
1 parent 781ce9d commit 845cf93
Show file tree
Hide file tree
Showing 97 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion tests/config/issue-5801-v2.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
max_width = 120
version = "Two"
attr_fn_like_width = 120
attr_fn_like_width = 120
2 changes: 1 addition & 1 deletion tests/source/arrow_in_comments/arrow_in_single_comment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
fn main() {
match a {
_ =>
Expand Down
2 changes: 1 addition & 1 deletion tests/source/arrow_in_comments/multiple_arrows.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
fn main() {
match a {
_ => // comment with =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015
// rustfmt-error_on_line_overflow: false
// rustfmt-indent_style: Block

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-error_on_line_overflow: false
// rustfmt-indent_style: Block

Expand Down
2 changes: 1 addition & 1 deletion tests/source/fn-single-line/version_one.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_single_line: true
// rustfmt-version: One
// rustfmt-style_edition: 2015
// Test single-line functions.

fn foo_expr() {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/fn-single-line/version_two.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_single_line: true
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// Test single-line functions.

fn foo_expr() {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-2179/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015
// rustfmt-error_on_line_overflow: false

fn issue_2179() {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-2179/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-error_on_line_overflow: false

fn issue_2179() {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3213/version_one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn foo() {
match 0 {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3213/version_two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn foo() {
match 0 {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3227/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn main() {
thread::spawn(|| {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3270/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

pub fn main() {
/* let s = String::from(
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3270/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

pub fn main() {
/* let s = String::from(
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3272/v1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn main() {
assert!(HAYSTACK
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3272/v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn main() {
assert!(HAYSTACK
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3278/version_one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

pub fn parse_conditional<'a, I: 'a>(
) -> impl Parser<Input = I, Output = Expr, PartialState = ()> + 'a
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3278/version_two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

pub fn parse_conditional<'a, I: 'a>()
-> impl Parser<Input = I, Output = Expr, PartialState = ()> + 'a
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3295/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
pub enum TestEnum {
a,
b,
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3302.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

macro_rules! moo1 {
() => {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3701/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn build_sorted_static_get_entry_names(
mut entries: Vec<(u8, &'static str)>,
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3701/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn build_sorted_static_get_entry_names(
mut entries: Vec<(u8, &'static str)>,
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3805.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-format_macro_matchers: true

// From original issue example - Line length 101
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3840/version-two_hard-tabs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-hard_tabs: true
// rustfmt-version: Two
// rustfmt-style_edition: 2024

impl<Target: FromEvent<A> + FromEvent<B>, A: Widget2<Ctx = C>, B: Widget2<Ctx = C>, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter<Target, A, B>
{
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3840/version-two_soft-tabs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

impl<Target: FromEvent<A> + FromEvent<B>, A: Widget2<Ctx = C>, B: Widget2<Ctx = C>, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter<Target, A, B>
{
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-4530.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
fn main() {
let [aaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccc, ddddddddddddddddddddddddd] = panic!();
}
2 changes: 1 addition & 1 deletion tests/source/issue-4689/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

// Based on the issue description
pub trait PrettyPrinter<'tcx>:
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-4689/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

// Based on the issue description
pub trait PrettyPrinter<'tcx>:
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-5586.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
fn main() {
// sample 1
{
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-5655/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn foo<T>(_: T)
where
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-5655/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn foo<T>(_: T)
where
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-5987/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn main() {
trace!(
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-6147/case_rustfmt_v1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

pub fn main() {
let a = Some(12);
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-6147/case_rustfmt_v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

pub fn main() {
let a = Some(12);
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue_5027.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

pub type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)>+ ExactSizeIterator+ 'a;

Expand Down
2 changes: 1 addition & 1 deletion tests/source/let_else_v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-single_line_let_else_max_width: 100

fn issue5901() {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/long-fn-1/version_one.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion tests/source/long-fn-1/version_two.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion tests/source/one_line_if_v1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn plain_if(x: bool) -> u8 {
if x {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/one_line_if_v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn plain_if(x: bool) -> u8 {
if x {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/single-line-macro/v1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

// #2652
// Preserve trailing comma inside macro, even if it looks an array.
Expand Down
2 changes: 1 addition & 1 deletion tests/source/single-line-macro/v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

// #2652
// Preserve trailing comma inside macro, even if it looks an array.
Expand Down
2 changes: 1 addition & 1 deletion tests/source/trailing_comments/hard_tabs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-wrap_comments: true
// rustfmt-hard_tabs: true

Expand Down
2 changes: 1 addition & 1 deletion tests/source/trailing_comments/soft_tabs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-wrap_comments: true

pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast
Expand Down
2 changes: 1 addition & 1 deletion tests/source/tuple_v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn issue_4355() {
let _ = ((1,),).0 .0;
Expand Down
2 changes: 1 addition & 1 deletion tests/target/arrow_in_comments/arrow_in_single_comment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
fn main() {
match a {
_ =>
Expand Down
2 changes: 1 addition & 1 deletion tests/target/arrow_in_comments/multiple_arrows.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
fn main() {
match a {
_ =>
Expand Down
2 changes: 1 addition & 1 deletion tests/target/fn-single-line/version_one.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_single_line: true
// rustfmt-version: One
// rustfmt-style_edition: 2015
// Test single-line functions.

fn foo_expr() { 1 }
Expand Down
2 changes: 1 addition & 1 deletion tests/target/fn-single-line/version_two.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_single_line: true
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// Test single-line functions.

fn foo_expr() { 1 }
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-2179/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015
// rustfmt-error_on_line_overflow: false

fn issue_2179() {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-2179/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
// rustfmt-error_on_line_overflow: false

fn issue_2179() {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3132.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn test() {
/*
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3213/version_one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn foo() {
match 0 {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3213/version_two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn foo() {
match 0 {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3227/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn main() {
thread::spawn(|| {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3227/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn main() {
thread::spawn(|| {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3270/one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

pub fn main() {
/* let s = String::from(
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3270/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

pub fn main() {
/* let s = String::from(
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3270/wrap.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3272/v1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

fn main() {
assert!(HAYSTACK
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3272/v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

fn main() {
assert!(
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3278/version_one.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: One
// rustfmt-style_edition: 2015

pub fn parse_conditional<'a, I: 'a>(
) -> impl Parser<Input = I, Output = Expr, PartialState = ()> + 'a
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3278/version_two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024

pub fn parse_conditional<'a, I: 'a>()
-> impl Parser<Input = I, Output = Expr, PartialState = ()> + 'a
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3295/two.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-version: Two
// rustfmt-style_edition: 2024
pub enum TestEnum {
a,
b,
Expand Down
Loading

0 comments on commit 845cf93

Please sign in to comment.