mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 04:14:28 +00:00
parent
79c5ee8b42
commit
90c5792565
@ -1055,10 +1055,10 @@ Format the bodies of macros.
|
||||
|
||||
```rust
|
||||
macro_rules! foo {
|
||||
($a:ident : $b:ty) => {
|
||||
($a: ident : $b: ty) => {
|
||||
$a(42): $b;
|
||||
};
|
||||
($a:ident $b:ident $c:ident) => {
|
||||
($a: ident $b: ident $c: ident) => {
|
||||
$a = $b + $c;
|
||||
};
|
||||
}
|
||||
@ -1068,8 +1068,8 @@ macro_rules! foo {
|
||||
|
||||
```rust
|
||||
macro_rules! foo {
|
||||
($a:ident : $b:ty) => { $a(42): $b; };
|
||||
($a:ident $b:ident $c:ident) => { $a=$b+$c; };
|
||||
($a: ident : $b: ty) => { $a(42): $b; };
|
||||
($a: ident $b: ident $c: ident) => { $a=$b+$c; };
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -53,7 +53,7 @@ create_config! {
|
||||
license_template_path: String, String::default(), false,
|
||||
"Beginning of file must match license template";
|
||||
format_strings: bool, false, false, "Format string literals where necessary";
|
||||
format_macro_matchers: bool, true, false,
|
||||
format_macro_matchers: bool, false, false,
|
||||
"Format the metavariable matching patterns in macros";
|
||||
format_macro_bodies: bool, true, false, "Format the bodies of macros";
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
// rustfmt-format_macro_matchers: true
|
||||
|
||||
macro_rules! m {
|
||||
() => ();
|
||||
|
@ -1,4 +1,5 @@
|
||||
// rustfmt-normalize_comments: true
|
||||
// rustfmt-format_macro_matchers: true
|
||||
itemmacro!(this, is.now() .formatted(yay));
|
||||
|
||||
itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());
|
||||
|
@ -1,3 +1,5 @@
|
||||
// rustfmt-format_macro_matchers: true
|
||||
|
||||
macro_rules! m {
|
||||
() => {};
|
||||
($x:ident) => {};
|
||||
|
@ -1,4 +1,5 @@
|
||||
// rustfmt-normalize_comments: true
|
||||
// rustfmt-format_macro_matchers: true
|
||||
itemmacro!(this, is.now().formatted(yay));
|
||||
|
||||
itemmacro!(
|
||||
|
Loading…
Reference in New Issue
Block a user