Skip to content

Allow patterns in macros to be followed by if and in. #25713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2015

Conversation

Stebalien
Copy link
Contributor

Needed to support:

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.

Needed to support:

match X {
  pattern if Y ...
}

for pattern in Y {}
@rust-highfive
Copy link
Contributor

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@Stebalien Stebalien changed the title Allow patterns to be followed by if and in. Allow patterns in macros to be followed by if and in. May 22, 2015
@huonw
Copy link
Member

huonw commented May 24, 2015

Thoughts? @cmr, @nikomatsakis

@emberian
Copy link
Member

Seems reasonable, we can't break this.

@alexcrichton
Copy link
Member

@bors: r+ f21655e

I agree with @cmr!

bors added a commit that referenced this pull request May 27, 2015
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.
@bors
Copy link
Collaborator

bors commented May 27, 2015

⌛ Testing commit f21655e with merge e4c64a1...

@bors bors merged commit f21655e into rust-lang:master May 27, 2015
@Stebalien Stebalien deleted the pattern branch June 11, 2015 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants