rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Format Rust code

Results 485 rustfmt issues
Sort by recently updated
recently updated
newest added

Just some minor code cleanups.

pr-not-reviewed

If you format... ```rust #[allow()] unsafe extern "C" { #[allow()] pub fn foo(#[allow()] arg: *mut u8, #[allow()]...); } ``` Then it will format into ```rust #[allow()] unsafe extern "C" {...

bug
good first issue

```rust // rustfmt-wrap_comments: true /// ```xxx``` /// /// xxx pub struct X; ``` ```console $ rustfmt --check --config=wrap_comments=true :4:4:4 | 4 | /// | ^ | = note: set `error_on_unformatted...

duplicate
a-comments
only-with-option
e-trailing whitespace

Tracking issue documenting `style_edition=2027` changes.

documentation

It's unlikely that Rustfmt 2.0 will be released for a while, if ever, so it would be nice if `--skip-children` could be stabilised so we can use stable Rustfmt with...

stabilisation-request

I really don't know how to describe this ... How i found it ??? This is the simplest case I've tried to summarize. For the code: ``` rust mod any...

a-closures

```sh ❯ rustfmt --version rustfmt 1.8.0-stable (4d91de4e48 2025-02-17) ``` Consider the following file `foo.rs`: ```rust fn f() {} // This has trailing whitespace ``` The trailing whitespace remains when calling...

e-trailing whitespace
a-2024-edition

```rust fn a() -> /* my super detailed comment on what this bool is */ bool {} ``` The comment is entirely eaten: ```rust fn a() -> bool {} ```

a-comments

Documentation mentions at - https://rust-lang.github.io/rustfmt/?version=v1.8.0&search=#inline_attribute_width - https://rust-lang.github.io/rustfmt/?version=v1.8.0&search=#enum_discrim_align_threshold ``` Default value: 0 Possible values: any positive integer ``` This is misleading/contradicting because 0 is not a positive integer.

I think this is the correct behavior. Also see #5364

pr-not-reviewed