rustfmt
rustfmt copied to clipboard
Format Rust code
Fixes #3255 , Fixes #3994 , Closing #4715
Suggested fix for issue #4273. The main change is in `add_misformatted_file()` to use the proper newline styles in each of the `original/expected` fields in each `MismatchedBlock`. The original code's newline...
Suggest fix for issue #4499 - `skip` attribute in `struct impl` and in other cases. The changes are basically to all calls to `push_skipped_with_span()` where the 2nd parameter was `x.span`....
Add handling of comments between Trait Generics and Bounds by using rewrite_assign_rhs_with_comments() (one of the cases identified in #4626 discussion). Also added workaround for an issue that a comment before...
Fixes #4654 The trailing comma being inserted no longer causes a subsequent comment to be moved up. This change does not affect the [`trailing_comma`] configuration. [`trailing_comma`]: https://rust-lang.github.io/rustfmt/?version=master&search=#trailing_comma ----- This change...
Fixes #4027 .
Code blocks in a `//!` doc comment don't seem to be formatted. ```rust mod foo { //! ``` //! horribly .formatted(code //! ); //! ``` } ``` This is on...
Examples: ```rust enum Enum{ Variant { field /*comment*/ : i32} } struct S { field /* comment */ : i32 } ``` Both comments get removed without any warning. Since...
```rust fn host_perf_check() -> Result { #[cfg(not(build_type = "release"))] return Err(PerfCheckError::WrongBuildType.into()) #[allow(unreachable_code)] #[cfg(not(feature = "hostperfcheck"))] return Err(PerfCheckError::FeatureNotEnabled { feature: "hostperfcheck" }.into()) #[cfg(all(build_type = "release", feature = "hostperfcheck"))] { crate::host_perf_check::host_perf_check()?; Ok(())...