@@ -15,8 +15,8 @@ macro_rules! m {
15
15
) => { } ;
16
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
21
( $foo: tt foo[ $attr: meta] $name: ident) => { } ;
22
22
( $foo: tt[ $attr: meta] $name: ident) => { } ;
@@ -28,7 +28,7 @@ macro_rules! m {
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,7 +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) ->
52
+ $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty, $c: ident : $tc: ty) ->
53
53
$ret: ty { $body: expr }
54
54
) => {
55
55
fn $n( $a: $ta, $b: $tb, $c: $tc) -> $ret {
@@ -62,7 +62,7 @@ macro_rules! impl_a_method {
62
62
}
63
63
} ;
64
64
(
65
- $n: ident( $a: ident: $ta: ty, $b: ident: $tb: ty, $c: ident: $tc: ty, $d: ident: $td: ty) ->
65
+ $n: ident( $a: ident : $ta: ty, $b: ident : $tb: ty, $c: ident : $tc: ty, $d: ident : $td: ty) ->
66
66
$ret: ty { $body: expr }
67
67
) => {
68
68
fn $n( $a: $ta, $b: $tb, $c: $tc, $d: $td) -> $ret {
@@ -179,3 +179,9 @@ macro foo($type_name: ident, $docs: expr) {
179
179
#[ derive( Debug , Clone , Copy ) ]
180
180
pub struct $type_name;
181
181
}
182
+
183
+ // #2534
184
+ macro_rules! foo {
185
+ ( $a: ident : $b: ty) => { } ;
186
+ ( $a: ident $b: ident $c: ident) => { } ;
187
+ }
0 commit comments