Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retain trailing comments in module when using rustfmt::skip attribute
Resolves 5033 Trailing comments at the end of the root Module were removed because the module span did not extend until the end of the file. The root Module's span now encompasses the entire file, which ensures that no comments are lost when using ``#![rustfmt::skip]``
- Loading branch information
1 parent
8b766f3
commit bc46af9
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// leading comment | ||
|
||
#![rustfmt::skip] | ||
fn main() { | ||
println!("main"); // commented | ||
} | ||
|
||
// post comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![rustfmt::skip] | ||
|
||
mod a { | ||
mod b { | ||
|
||
} | ||
|
||
// trailing comment b | ||
} | ||
|
||
// trailing comment a |