Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
494: Macro called in pattern-without-range expand to a _single_ pattern r=Veykril a=scrabsha The current specification says that a macro called in pattern context can expand to zero or more patterns. I believe this is incorrect, as e.g. `0 1 _` is effectively 0 or more patterns, but is not a valid expansion ([playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=86464c2a830b8d5550cd7947275d7dee)). Similarly, expanding to 0 patterns is invalid ([playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f56438b84bed3893105ba138af8913a6)). As I understand it, the intent was to state that e.g. `0 | 1 | _` is a valid expansion for a pattern called in pattern context. As such, I changed the wording so that macro calls in pattern context must expand to a pattern, which matches `0 | 1 | _` and makes "expanding to zero patterns" invalid. Co-authored-by: Sasha Pourcelot <[email protected]>
- Loading branch information