Fix #2346: empty comments should not have any trailing space added

This commit is contained in:
Johannes Linke 2018-02-18 12:47:42 +01:00
parent 263104a365
commit 8e36d54202
2 changed files with 5 additions and 1 deletions

View file

@ -466,7 +466,7 @@ fn rewrite_comment_inner(
}
result.push_str(closer);
if result == opener && result.ends_with(' ') {
if result.ends_with(opener) && opener.ends_with(' ') {
// Trailing space.
result.pop();
}

View file

@ -0,0 +1,4 @@
// rustfmt-normalize_comments: true
// the following empty comment should not have any trailing space added.
//
fn main() {}