]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #30406 - durka:patch-13, r=sanxiyn
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 18 Dec 2015 08:13:46 +0000 (13:43 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 18 Dec 2015 11:17:38 +0000 (16:47 +0530)
The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )

src/doc/book/macros.md

index f7f27858cd24042a5342ca292da7b93b331223d4..e4a900a2b1a4f8c79b9d7e538460d64680d4878e 100644 (file)
@@ -485,10 +485,10 @@ These rules provide some flexibility for Rust’s syntax to evolve without
 breaking existing macros.
 
 The macro system does not deal with parse ambiguity at all. For example, the
-grammar `$($t:ty)* $e:expr` will always fail to parse, because the parser would
-be forced to choose between parsing `$t` and parsing `$e`. Changing the
+grammar `$($i:ident)* $e:expr` will always fail to parse, because the parser would
+be forced to choose between parsing `$i` and parsing `$e`. Changing the
 invocation syntax to put a distinctive token in front can solve the problem. In
-this case, you can write `$(T $t:ty)* E $e:exp`.
+this case, you can write `$(I $i:ident)* E $e:expr`.
 
 [item]: ../reference.html#items