diff options
Diffstat (limited to 'src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs')
-rw-r--r-- | src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs b/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs deleted file mode 100644 index fc80d51c7..000000000 --- a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![warn(indirect_structural_match)] - -struct NoEq; - -enum Foo { - Bar, - Baz, - Qux(NoEq), -} - -// Even though any of these values can be compared structurally, we still disallow it in a pattern -// because `Foo` does not impl `PartialEq`. -const BAR_BAZ: Foo = if 42 == 42 { - Foo::Baz -} else { - Foo::Bar -}; - -fn main() { - match Foo::Qux(NoEq) { - BAR_BAZ => panic!(), - //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` - _ => {} - } -} |