diff --git a/src/test/ui/or-patterns/issue-68785-irrefutable-param-with-at.rs b/src/test/ui/or-patterns/issue-68785-irrefutable-param-with-at.rs new file mode 100644 index 0000000000000..1a65a1e544b9e --- /dev/null +++ b/src/test/ui/or-patterns/issue-68785-irrefutable-param-with-at.rs @@ -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)); +}