Skip to content

Commit de16ed3

Browse files
Correctly handle comments in attributes in doctests source code
1 parent 5a6036a commit de16ed3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustdoc/doctest/make.rs

+2
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ fn handle_attr(mod_attr_pending: &mut String, source_info: &mut SourceInfo, edit
520520
mod_attr_pending.clear();
521521
} else if mod_attr_pending.ends_with('\\') {
522522
mod_attr_pending.push('n');
523+
} else {
524+
mod_attr_pending.push_str("\n");
523525
}
524526
}
525527

0 commit comments

Comments
 (0)