rustfmt
rustfmt copied to clipboard
Format Rust code
!!! REQUIRES DEBUG ASSERTIONS !!! ````rust #[no_mangle] static FOO: () = (); fn main() { extern "fail " { fn FOO(); } unsafe { FOO() } //~ ERROR: attempt to...
Tracking issue for unstable option: control_brace_style
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 {}...
> 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...
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...
_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...
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...
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...