rustfmt
rustfmt copied to clipboard
Format Rust code
```rust fn main() { println!("{}", builtin # offset_of(A, 0. 1.1.1)); } ``` ``` thread 'main' panicked at src/tools/rustfmt/src/expr.rs:407:13: internal error: entered unreachable code stack backtrace: 0: 0x7f5d061634ec - std::backtrace_rs::backtrace::libunwind::trace::h735859f22ae1ae42 at...
This: ```rust fn main() { let (/**/ () /**/ | /**/ () /**/) = (); } ``` gets turned into this: ```rust fn main() { let (() | ()) =...
Self-explanatory. cc rust-lang/rust#114901 This implementation is probably super busted. I have no idea what most of these options in rustfmt mean, lol.
```rust trait Trait { fn foo(&self) -> u32 { 0 } } struct F; impl Trait for S { reuse to_reuse::foo { self } reuse ::foo; } ``` `rustfmt 1.7.0-nightly...
this addresses a panic when `rustfmt --check` makes a `write()` call that fails. There have been a few issues that already discussed this: https://github.com/rust-lang/rustfmt/issues/5114 https://github.com/rust-lang/rustfmt/issues/2926 On one of the issues...
## Background RFC "Style Evolution" (https://github.com/rust-lang/rfcs/pull/3338). Upstream tracking issue: https://github.com/rust-lang/rust/issues/105336 ## Requirements For The New `style_edition` config After reading through the RFC these are the key requirements I found: *...
I wondered why suddenly only half of my file got formatted and boiled down the code to the following MWE: ```rust fn main() { match e { // this line...
Test: ```shell > echo "m!(const N: usize = 0;);" | rustup run beta rustfmt m!( const N: usize = 0; ); > echo "m!(const N: usize = 0;);" | rustup...
The following snippet is formatted using rustfmt. ```rust match Some(1) { Some(number) => ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", number, ) .to_owned(), None => ("test", 0).to_owned(), }; ``` In my opinion, this is not...