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

!!! REQUIRES DEBUG ASSERTIONS !!! ````rust #[no_mangle] static FOO: () = (); fn main() { extern "fail " { fn FOO(); } unsafe { FOO() } //~ ERROR: attempt to...

bug

Tracking issue for unstable option: control_brace_style

unstable option

Without `merge_derives`, rustfmt leaves the following code as-is: ```rust #[repr(u8)] #[derive( Copy, Clone, Component, Serialize, Deserialize, Debug, Hash, PartialOrd, Ord, PartialEq, Eq, IntEnum, Sequence, Reflect, )] pub struct Waymark {}...

needs-mcve

> Manually transferred from rust-lang/rust#120551. > Originally reported by @max-ishere. --- `cargo fmt` fails to format document with `#[test_case()]` macro when there is a trailing space inside the macro. Code...

a-macros
e-trailing whitespace

Example code: ```rust pub fn try_new_with_date_length_unstable( provider: &P, locale: &DataLocale, length: length::Date, ) -> Result where P: // Explanatory comment about the bounds ?Sized + DataProvider + DataProvider + DataProvider...

bug
a-comments

_From https://news.ycombinator.com/item?id=39121489_ > I've had cargo fmt eat my files when I was out of disk space. It created a new file, but the file length was 0, and my...

Fixes #5623 When formatting code snippets in doc comments, we start by wrapping the content of the code block in an `fn main(){}` and add indentation. We do this because...

pr-not-reviewed

In a macro that takes a path as an argument: ```rust macro_rules! get_msg { ($module:path) => { let message = { use $module::{MESSAGE}; // note the (usually unnecessary) brackets MESSAGE...

bug
a-macros

To the best of my knowledge we don't have this info captured anywhere in a single place, but it's something we should have. Unfortunately I think the only way to...

documentation