2
2
3
3
macro_rules! m {
4
4
( ) => { } ;
5
- ( $x: ident) => { } ;
6
- ( $m1: ident, $m2: ident, $x: ident) => { } ;
7
- ( $( $beginning: ident) ,* ; $middle: ident; $( $end: ident) ,* ) => { } ;
5
+ ( $x: ident) => { } ;
6
+ ( $m1: ident, $m2: ident, $x: ident) => { } ;
7
+ ( $( $beginning: ident) ,* ; $middle: ident; $( $end: ident) ,* ) => { } ;
8
8
(
9
- $( $beginning: ident) ,* ;
10
- $middle: ident;
11
- $( $end: ident) ,* ;
12
- $( $beginning: ident) ,* ;
13
- $middle: ident;
14
- $( $end: ident) ,*
9
+ $( $beginning: ident) ,* ;
10
+ $middle: ident;
11
+ $( $end: ident) ,* ;
12
+ $( $beginning: ident) ,* ;
13
+ $middle: ident;
14
+ $( $end: ident) ,*
15
15
) => { } ;
16
- ( $name: ident( $( $dol: tt $var: ident) * ) $( $body: tt) * ) => { } ;
16
+ ( $name: ident( $( $dol: tt $var: ident) * ) $( $body: tt) * ) => { } ;
17
17
(
18
- $( $i: ident : $ty: ty, $def: expr, $stb: expr, $( $dstring: tt) ,+) ;+ $( ; ) *
19
- $( $i: ident : $ty: ty, $def: expr, $stb: expr, $( $dstring: tt) ,+) ;+ $( ; ) *
18
+ $( $i: ident : $ty: ty, $def: expr, $stb: expr, $( $dstring: tt) ,+) ;+ $( ; ) *
19
+ $( $i: ident : $ty: ty, $def: expr, $stb: expr, $( $dstring: tt) ,+) ;+ $( ; ) *
20
20
) => { } ;
21
- ( $foo: tt foo[ $attr: meta] $name: ident) => { } ;
22
- ( $foo: tt[ $attr: meta] $name: ident) => { } ;
23
- ( $foo: tt & ' a[ $attr: meta] $name: ident) => { } ;
24
- ( $foo: tt foo #[ $attr: meta] $name: ident) => { } ;
25
- ( $foo: tt #[ $attr: meta] $name: ident) => { } ;
26
- ( $foo: tt & ' a #[ $attr: meta] $name: ident) => { } ;
27
- ( $x: tt foo bar foo bar foo bar $y: tt => x * y * z $z: tt, $( $a: tt) ,* ) => { } ;
21
+ ( $foo: tt foo[ $attr: meta] $name: ident) => { } ;
22
+ ( $foo: tt[ $attr: meta] $name: ident) => { } ;
23
+ ( $foo: tt & ' a[ $attr: meta] $name: ident) => { } ;
24
+ ( $foo: tt foo #[ $attr: meta] $name: ident) => { } ;
25
+ ( $foo: tt #[ $attr: meta] $name: ident) => { } ;
26
+ ( $foo: tt & ' a #[ $attr: meta] $name: ident) => { } ;
27
+ ( $x: tt foo bar foo bar foo bar $y: tt => x * y * z $z: tt, $( $a: tt) ,* ) => { } ;
28
28
}
29
29
30
30
macro_rules! impl_a_method {
31
- ( $n: ident( $a: ident : $ta: ty) -> $ret: ty { $body: expr } ) => {
31
+ ( $n: ident( $a: ident : $ta: ty) -> $ret: ty { $body: expr } ) => {
32
32
fn $n( $a: $ta) -> $ret {
33
33
$body
34
34
}
@@ -38,7 +38,7 @@ macro_rules! impl_a_method {
38
38
} ;
39
39
}
40
40
} ;
41
- ( $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty) -> $ret: ty { $body: expr } ) => {
41
+ ( $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty) -> $ret: ty { $body: expr } ) => {
42
42
fn $n( $a: $ta, $b: $tb) -> $ret {
43
43
$body
44
44
}
@@ -49,8 +49,7 @@ macro_rules! impl_a_method {
49
49
}
50
50
} ;
51
51
(
52
- $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty, $c: ident : $tc: ty) ->
53
- $ret: ty { $body: expr }
52
+ $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty, $c: ident : $tc: ty) -> $ret: ty { $body: expr }
54
53
) => {
55
54
fn $n( $a: $ta, $b: $tb, $c: $tc) -> $ret {
56
55
$body
@@ -62,8 +61,8 @@ macro_rules! impl_a_method {
62
61
}
63
62
} ;
64
63
(
65
- $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty, $c: ident : $tc: ty, $d: ident : $td: ty) ->
66
- $ret: ty { $body: expr }
64
+ $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty, $c: ident : $tc: ty, $d: ident : $td: ty) ->
65
+ $ret: ty { $body: expr }
67
66
) => {
68
67
fn $n( $a: $ta, $b: $tb, $c: $tc, $d: $td) -> $ret {
69
68
$body
@@ -78,7 +77,7 @@ macro_rules! impl_a_method {
78
77
79
78
macro_rules! m {
80
79
// a
81
- ( $expr: expr, $( $func: ident) * ) => { {
80
+ ( $expr: expr, $( $func: ident) * ) => { {
82
81
let x = $expr;
83
82
$func( x)
84
83
} } ;
@@ -91,7 +90,7 @@ macro_rules! m {
91
90
( @tag) => { } ;
92
91
93
92
// d
94
- ( $item: ident) => {
93
+ ( $item: ident) => {
95
94
mod macro_item {
96
95
struct $item;
97
96
}
@@ -100,7 +99,7 @@ macro_rules! m {
100
99
101
100
macro m2 {
102
101
// a
103
- ( $expr: expr, $( $func: ident) * ) => { {
102
+ ( $expr: expr, $( $func: ident) * ) => { {
104
103
let x = $expr;
105
104
$func( x)
106
105
} }
@@ -113,7 +112,7 @@ macro m2 {
113
112
( @tag) => { }
114
113
115
114
// d
116
- ( $item: ident) => {
115
+ ( $item: ident) => {
117
116
mod macro_item {
118
117
struct $item;
119
118
}
@@ -156,10 +155,10 @@ macro_rules! m {
156
155
// #2439
157
156
macro_rules! m {
158
157
(
159
- $line0_xxxxxxxxxxxxxxxxx: expr,
160
- $line1_xxxxxxxxxxxxxxxxx: expr,
161
- $line2_xxxxxxxxxxxxxxxxx: expr,
162
- $line3_xxxxxxxxxxxxxxxxx: expr,
158
+ $line0_xxxxxxxxxxxxxxxxx: expr,
159
+ $line1_xxxxxxxxxxxxxxxxx: expr,
160
+ $line2_xxxxxxxxxxxxxxxxx: expr,
161
+ $line3_xxxxxxxxxxxxxxxxx: expr,
163
162
) => { } ;
164
163
}
165
164
@@ -173,7 +172,7 @@ macro_rules! m [
173
172
] ;
174
173
175
174
// #2470
176
- macro foo( $type_name: ident, $docs: expr) {
175
+ macro foo( $type_name: ident, $docs: expr) {
177
176
#[ allow( non_camel_case_types) ]
178
177
#[ doc=$docs]
179
178
#[ derive( Debug , Clone , Copy ) ]
@@ -182,13 +181,13 @@ macro foo($type_name: ident, $docs: expr) {
182
181
183
182
// #2534
184
183
macro_rules! foo {
185
- ( $a: ident : $b: ty) => { } ;
186
- ( $a: ident $b: ident $c: ident) => { } ;
184
+ ( $a: ident : $b: ty) => { } ;
185
+ ( $a: ident $b: ident $c: ident) => { } ;
187
186
}
188
187
189
188
// #2538
190
189
macro_rules! add_message_to_notes {
191
- ( $msg: expr) => { {
190
+ ( $msg: expr) => { {
192
191
let mut lines = message. lines( ) ;
193
192
notes. push_str( & format!( "\n {}: {}" , level, lines. next( ) . unwrap( ) ) ) ;
194
193
for line in lines {
0 commit comments