diff options
Diffstat (limited to 'src/test/ui/pattern/bindings-after-at/or-patterns.rs')
-rw-r--r-- | src/test/ui/pattern/bindings-after-at/or-patterns.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/test/ui/pattern/bindings-after-at/or-patterns.rs b/src/test/ui/pattern/bindings-after-at/or-patterns.rs deleted file mode 100644 index fcc361489..000000000 --- a/src/test/ui/pattern/bindings-after-at/or-patterns.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Test bindings-after-at with or-patterns - -// run-pass - - -#[derive(Debug, PartialEq)] -enum MatchArm { - Arm(usize), - Wild, -} - -#[derive(Debug, Clone, Copy, PartialEq)] -enum Test { - Foo, - Bar, - Baz, - Qux, -} - -fn test(foo: Option<Test>) -> MatchArm { - match foo { - bar @ Some(Test::Foo | Test::Bar) => { - assert!(bar == Some(Test::Foo) || bar == Some(Test::Bar)); - - MatchArm::Arm(0) - }, - Some(_) => MatchArm::Arm(1), - _ => MatchArm::Wild, - } -} - -fn main() { - assert_eq!(test(Some(Test::Foo)), MatchArm::Arm(0)); - assert_eq!(test(Some(Test::Bar)), MatchArm::Arm(0)); - assert_eq!(test(Some(Test::Baz)), MatchArm::Arm(1)); - assert_eq!(test(Some(Test::Qux)), MatchArm::Arm(1)); - assert_eq!(test(None), MatchArm::Wild); -} |