You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct A {
t: i64
}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
// test
}
}
If I format it using command rustfmt --write-mode=diff --file-lines '[{"file": "src/lib.rs", "range": [0, 2]}]' src/lib.rs, only first two lines should be formatted, but I got these output:
Warning: Extra file listed in file_lines option '/tmp/testfmt/src/lib.rs'
Diff in src/lib.rs at line 1:
struct A {⏎
-t: i64⏎
+ t: i64,⏎
}⏎
⏎
#[cfg(test)]⏎
Diff in src/lib.rs at line 6:
mod tests {⏎
#[test]⏎
fn it_works() {⏎
- // test⏎
+ // test⏎
}⏎
}⏎
It tries to format the comment at L9 too.
The text was updated successfully, but these errors were encountered:
As mentioned in #1514 (comment) I'm not so sure this is a bug as much as incomplete implementation. I had named the flag --experimental-file-lines but changed it to --file-lines during review.
Consider following file
If I format it using command
rustfmt --write-mode=diff --file-lines '[{"file": "src/lib.rs", "range": [0, 2]}]' src/lib.rs
, only first two lines should be formatted, but I got these output:It tries to format the comment at L9 too.
The text was updated successfully, but these errors were encountered: