rustfmt
rustfmt copied to clipboard
Format Rust code
**Describe the bug** When a workspace has bin and lib packages, specifying a manifest path in the invocation of `cargo fmt` makes `cargo fmt` fail to find targets. ```bash $...
Version: `rustfmt 1.8.0-nightly (75530e9f72 2025-03-18)` In my Wasmi project I have got the following Rust line of code: ```rust /// Executes an [`Instruction::CallImported`]. pub fn execute_call_imported( &mut self, store: &mut...
Related to #6060 and #6044. For the below snippet, rustfmt does nothing at all: ```rust enum Foo { A, B, C, D, } fn main() { let foo = Foo::A;...
Disclaimer: This has a very low priority given feature `fn_delegation` (https://github.com/rust-lang/rust/issues/118212) is highly experimental and since it's not guaranteed that this feature will persist. Still, for the sake of coverage,...
Similar to PR #5252 but copies the structure of `types::rewrite_generic_args`. I'm making this PR since #5252 hasn't had any progress since 2022. The tests are copied from #5252.
```rs fn a() -> impl Sized + use {} fn b() -> impl use + Sized {} ``` An order should be chosen. Does the `use` go at the front...
The type of indentation is not important for error reporting. However, keeping the indentation as tabs has two issues: 1. rustfmt keeps track of widths, not character offsets. For space...
Here's the code it died on [https://github.com/lbfalvy/orchid/tree/e0d246fe1fa75405305ec4390ba6815049246726](https://github.com/lbfalvy/orchid/tree/e0d246fe1fa75405305ec4390ba6815049246726) Logfile the panic asked me to attach [rustc-ice-2025-01-12T01_00_58-10688.txt](https://github.com/user-attachments/files/18387767/rustc-ice-2025-01-12T01_00_58-10688.txt)
A long type path could look like `long_type_path::long_type_path::long_type_path::long_type_path::long_type_path::long_type_path::long_type_path::long_type_path::long_type_path::long_type_path::Long` which currently would not get formatted. This fix would break the path into multiple lines if necessary.