parent
2866634baf
commit
e70343a5f5
@ -353,6 +353,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
|
||||
let remaining = snippet[status.line_start..subslice.len() + offset].trim();
|
||||
if !remaining.is_empty() {
|
||||
self.push_str(&self.block_indent.to_string(self.config));
|
||||
self.push_str(remaining);
|
||||
status.line_start = subslice.len() + offset;
|
||||
}
|
||||
|
19
tests/source/issue-4398.rs
Normal file
19
tests/source/issue-4398.rs
Normal file
@ -0,0 +1,19 @@
|
||||
impl Struct {
|
||||
/// Documentation for `foo`
|
||||
#[rustfmt::skip] // comment on why use a skip here
|
||||
pub fn foo(&self) {}
|
||||
}
|
||||
|
||||
impl Struct {
|
||||
/// Documentation for `foo`
|
||||
#[rustfmt::skip] // comment on why use a skip here
|
||||
pub fn foo(&self) {}
|
||||
}
|
||||
|
||||
/// Documentation for `Struct`
|
||||
#[rustfmt::skip] // comment
|
||||
impl Struct {
|
||||
/// Documentation for `foo`
|
||||
#[rustfmt::skip] // comment on why use a skip here
|
||||
pub fn foo(&self) {}
|
||||
}
|
19
tests/target/issue-4398.rs
Normal file
19
tests/target/issue-4398.rs
Normal file
@ -0,0 +1,19 @@
|
||||
impl Struct {
|
||||
/// Documentation for `foo`
|
||||
#[rustfmt::skip] // comment on why use a skip here
|
||||
pub fn foo(&self) {}
|
||||
}
|
||||
|
||||
impl Struct {
|
||||
/// Documentation for `foo`
|
||||
#[rustfmt::skip] // comment on why use a skip here
|
||||
pub fn foo(&self) {}
|
||||
}
|
||||
|
||||
/// Documentation for `Struct`
|
||||
#[rustfmt::skip] // comment
|
||||
impl Struct {
|
||||
/// Documentation for `foo`
|
||||
#[rustfmt::skip] // comment on why use a skip here
|
||||
pub fn foo(&self) {}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user