mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
Fix index bug in write_snippet_inner
This commit is contained in:
parent
b79094262f
commit
33a7357543
@ -173,7 +173,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
if !subslice
|
||||
.split('\n')
|
||||
.map(|s| s.trim_left())
|
||||
.any(|s| s.len() > 2 && &s[0..2] == "/*") {
|
||||
.any(|s| s.len() >= 2 && &s[0..2] == "/*") {
|
||||
// Add a newline after line comments
|
||||
self.buffer.push_str("\n");
|
||||
}
|
||||
|
6
tests/target/issue-1598.rs
Normal file
6
tests/target/issue-1598.rs
Normal file
@ -0,0 +1,6 @@
|
||||
fn main() {
|
||||
//foo
|
||||
/*
|
||||
*/
|
||||
format!("hello");
|
||||
}
|
Loading…
Reference in New Issue
Block a user