Skip to content

Support or-patterns (pat_0 | ... pat_n) in nested positions #2458

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

Closed
Centril opened this issue Dec 1, 2019 · 1 comment
Closed

Support or-patterns (pat_0 | ... pat_n) in nested positions #2458

Centril opened this issue Dec 1, 2019 · 1 comment

Comments

@Centril
Copy link
Contributor

Centril commented Dec 1, 2019

Tracking issue: rust-lang/rust#54883
RFC: rust-lang/rfcs#2535

The implementation history is available in the tracking issue, and I'm available if there are questions.

bors bot added a commit that referenced this issue Feb 10, 2020
3074: Or patterns r=matthewjasper a=matthewjasper

Works towards #2458

Co-authored-by: Matthew Jasper <[email protected]>
@bjorn3
Copy link
Member

bjorn3 commented Dec 20, 2020

fn foo(x: Option<u8>) {
    match x {
        Some(0 | 1..=255) | None => {}
    }
}

parses fine.

@bjorn3 bjorn3 closed this as completed Dec 20, 2020
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

No branches or pull requests

2 participants