Skip to content

Commit

Permalink
Add test case for rust-lang#6040
Browse files Browse the repository at this point in the history
  • Loading branch information
profetia committed Jul 5, 2024
1 parent 21afdb8 commit c50bdd8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/source/issue_6040.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
fn main() {
match e { // this line still gets formatted
MyStruct {
field_a,
.. // this comment here apparently causes trouble
} => (),
_ => (), // this line is no longer formatted
};
}

fn main() {
match e { // this line still gets formatted
MyStruct {
field_a,
field_b, // this should be aligned with field_a
field_c, // this should be aligned with field_a
} => (),

_ => (), // this line is no longer formatted
};
}
23 changes: 23 additions & 0 deletions tests/target/issue_6040.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
fn main() {
match e {
// this line still gets formatted
MyStruct {
field_a,
.. // this comment here apparently causes trouble
} => (),
_ => (), // this line is no longer formatted
};
}

fn main() {
match e {
// this line still gets formatted
MyStruct {
field_a,
field_b, // this should be aligned with field_a
field_c, // this should be aligned with field_a
} => (),

_ => (), // this line is no longer formatted
};
}

0 comments on commit c50bdd8

Please sign in to comment.