Skip to content

Remove newline in empty impl #2741

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

Merged
merged 5 commits into from
Jun 5, 2018
Merged

Remove newline in empty impl #2741

merged 5 commits into from
Jun 5, 2018

Conversation

csmoe
Copy link
Member

@csmoe csmoe commented May 27, 2018

Closes #2736

T: PartialEq,
{
}
T: PartialEq, {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these changes are incorrect - we should only use the {} form (c.f., with a newline) if the whole impl fits on one line. Also, we should not have a trailing comma if there is a brace on the same line.

@@ -28,7 +28,7 @@ impl<T> Foo for T
where
// comment2
// blah
T: Clone,
T: Clone
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing comma is trimmed since where clause contains comments. is it fine? @nrc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not remove the comma - we should keep the comma if it is mulit-line and remove it if it is single line. Whether it is multiline because there are multiple clauses or because of comments shouldn't matter.

@nrc
Copy link
Member

nrc commented Jun 4, 2018

@csmoe failing tests due to overlong line

@nrc nrc merged commit d9149fb into rust-lang:master Jun 5, 2018
@nrc
Copy link
Member

nrc commented Jun 5, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants