-
Notifications
You must be signed in to change notification settings - Fork 974
Open
Labels
A-macrosArea: macros (procedural macros, macro_rules! macros, etc.)Area: macros (procedural macros, macro_rules! macros, etc.)A-stringsArea: string literalsArea: string literalsI-poor-formattingIssue: poor formattingIssue: poor formattingP-lowLow priorityLow priority
Description
Rustfmt accepts the following code without issues:
pub const FOO: &str = foo("
foo
bar
");But if we are to replace foo with a function-like macro:
pub const FOO: &str = foo!("
foo
bar
");Rustfmt wants to reformat it as:
pub const FOO: &str = foo!(
"
foo
bar
"
);The resulting formatting is far from beautiful, space inefficient, and inconsistent with how rustfmt handles functions.
This issue is quite annoying in practice for example when code uses the hex-literal crate.
Metadata
Metadata
Assignees
Labels
A-macrosArea: macros (procedural macros, macro_rules! macros, etc.)Area: macros (procedural macros, macro_rules! macros, etc.)A-stringsArea: string literalsArea: string literalsI-poor-formattingIssue: poor formattingIssue: poor formattingP-lowLow priorityLow priority