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:
commit
e4c64a1499
3 changed files with 32 additions and 1 deletions
|
|
@ -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 Rust’s syntax to evolve without
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue