Rollup merge of #68842 - Centril:issue-68785, r=estebank

or_patterns: add regression test for #68785

Fixes https://github.com/rust-lang/rust/issues/68785.

(Fixed by https://github.com/rust-lang/rust/pull/67668.)

cc https://github.com/rust-lang/rust/issues/54883
r? @estebank
This commit is contained in:
Dylan DPC 2020-02-06 15:37:44 +01:00 committed by GitHub
commit 226a8e2932
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,14 @@
// check-pass
#![feature(or_patterns)]
enum MyEnum {
FirstCase(u8),
OtherCase(u16),
}
fn my_fn(x @ (MyEnum::FirstCase(_) | MyEnum::OtherCase(_)): MyEnum) {}
fn main() {
my_fn(MyEnum::FirstCase(0));
}