We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c4cc479 + f570438 commit 6efc963Copy full SHA for 6efc963
src/missed_spans.rs
@@ -260,9 +260,8 @@ impl<'a> FmtVisitor<'a> {
260
status.line_start = offset + subslice.len();
261
262
if let Some('/') = subslice.chars().nth(1) {
263
- // check that there are no contained block comments
264
- if !subslice.lines().any(|s| s.trim_left().starts_with("/*")) {
265
- // Add a newline after line comments
+ // Only add a newline if the last line is a line comment
+ if !subslice.trim_end().ends_with("*/") {
266
self.push_str("\n");
267
}
268
} else if status.line_start <= snippet.len() {
tests/target/issue-3124.rs
@@ -0,0 +1,14 @@
1
+pub fn fail1() {
2
+ // Some comment.
3
+ /**///
4
+}
5
+
6
+pub fn fail2() {
7
8
+ /**/
9
10
11
+pub fn fail3() {
12
13
+ //
14
0 commit comments