about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-28 07:06:29 +0000
committerbors <bors@rust-lang.org>2016-01-28 07:06:29 +0000
commit035f4cca00d20fcf889c8c588125cd07b632a476 (patch)
tree0964f52bc61ae56877fc3985c43638a9a35744ef
parent1c06f64ac2a27c76eaf4352eacdd260a4a62c0ec (diff)
parentfd4d013a2ce394fc73e83d8c13459289de1d72ba (diff)
Auto merge of #31240 - durka:follow-set-docs, r=pnkfelix
Missed as part of #31152, but the list had other mistakes as well.

r? @pnkfelix
-rw-r--r--src/doc/book/macros.md6
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/doc/book/macros.md b/src/doc/book/macros.md
index f5a0cd5e2c6..188abb316ab 100644
--- a/src/doc/book/macros.md
+++ b/src/doc/book/macros.md
@@ -478,9 +478,9 @@ which syntactic form it matches.
 
 There are additional rules regarding the next token after a metavariable:
 
-* `expr` variables may only be followed by one of: `=> , ;`
-* `ty` and `path` variables may only be followed by one of: `=> , : = > as`
-* `pat` variables may only be followed by one of: `=> , = if in`
+* `expr` and `stmt` variables may only be followed by one of: `=> , ;`
+* `ty` and `path` variables may only be followed by one of: `=> , = | ; : > [ { as where`
+* `pat` variables may only be followed by one of: `=> , = | if in`
 * Other variables may be followed by any token.
 
 These rules provide some flexibility for Rust’s syntax to evolve without
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index bfd76db0359..82fa0f8a8b2 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -972,6 +972,7 @@ fn can_be_followed_by_any(frag: &str) -> bool {
 /// we expanded `expr` to include a new binary operator, we might
 /// break macros that were relying on that binary operator as a
 /// separator.
+// when changing this do not forget to update doc/book/macros.md!
 fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
     if let &CloseDelim(_) = tok {
         // closing a token tree can never be matched by any fragment;