Auto merge of #25713 - Stebalien:pattern, r=alexcrichton

Needed to support:

```rust
match X {
  pattern if Y ...
}

for pattern in Y {}
```

IMO, this shouldn't require an RFC because it can't interfere with any future language changes (because `pattern if` and `pattern in` are already legal in rust) and can't cause any ambiguity.
This commit is contained in:
bors 2015-05-27 00:42:55 +00:00
commit e4c64a1499
3 changed files with 32 additions and 1 deletions

View file

@ -478,7 +478,7 @@ 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: `=> , =`
* `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 Rusts syntax to evolve without