-
Notifications
You must be signed in to change notification settings - Fork 915
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
Fix brace_style="PreferSameLine"
with trailing_comma="Vertical"
results
#5556
base: master
Are you sure you want to change the base?
Changes from all commits
a86f4cc
16befec
1f17b6c
316361f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ struct Lorem { | |
|
||
struct Dolor<T> | ||
where | ||
T: Eq, { | ||
T: Eq { | ||
sit: T, | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// rustfmt-brace_style: AlwaysNextLine | ||
// rustfmt-trailing_comma: Always | ||
|
||
fn lorem<S, T,>(lorem: S, ipsum: T,) | ||
where | ||
S: Add + Sub, | ||
T: Mul + Div, | ||
{ | ||
// body | ||
} | ||
Comment on lines
+4
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where clauses can appear in other contexts besides function definitions. Can we also add some examples with enum / struct definitions, and impl blocks to highlight how Also including some tests with a single where clause bound (e.g. just |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// rustfmt-brace_style: PreferSameLine | ||
// rustfmt-trailing_comma: Always | ||
|
||
fn lorem<S, T,>(lorem: S, ipsum: T,) | ||
where | ||
S: Add + Sub, | ||
T: Mul + Div, { | ||
// body | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// rustfmt-brace_style: SameLineWhere | ||
// rustfmt-trailing_comma: Always | ||
|
||
fn lorem<S, T,>(lorem: S, ipsum: T,) | ||
where | ||
S: Add + Sub, | ||
T: Mul + Div, | ||
{ | ||
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I don't understand the |
||
// body | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// rustfmt-brace_style: AlwaysNextLine | ||
// rustfmt-trailing_comma: Vertical | ||
|
||
fn lorem<S, T>(lorem: S, ipsum: T) | ||
where | ||
S: Add + Sub, | ||
T: Mul + Div, | ||
{ | ||
// body | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// rustfmt-brace_style: PreferSameLine | ||
// rustfmt-trailing_comma: Vertical | ||
|
||
fn lorem<S, T>(lorem: S, ipsum: T) | ||
where | ||
S: Add + Sub, | ||
T: Mul + Div { | ||
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this output, I'd actually expect there to be a trailing comma after |
||
// body | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// rustfmt-brace_style: SameLineWhere | ||
// rustfmt-trailing_comma: Vertical | ||
|
||
fn lorem<S, T>(lorem: S, ipsum: T) | ||
where | ||
S: Add + Sub, | ||
T: Mul + Div, | ||
{ | ||
// body | ||
} |
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.
Typically changing existing tests is not something we want to do and is usually a sign that the change needs to be version gated to prevent breaking formatting changes. However
brace_style
is an unstable option so the version gate might not be necessary in this caseThere 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.
I'll do it if I have to! 👍