about summary refs log tree commit diff
path: root/tests/ui/consts/const_in_pattern/no-eq-branch-fail.stderr
blob: 154c94c6d38545a459a1de47cabb0e5de04b7bc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
error: constant of non-structural type `Foo` in a pattern
  --> $DIR/no-eq-branch-fail.rs:19:9
   |
LL | enum Foo {
   | -------- `Foo` must be annotated with `#[derive(PartialEq)]` to be usable in patterns
...
LL | const BAR_BAZ: Foo = if 42 == 42 {
   | ------------------ constant defined here
...
LL |         BAR_BAZ => panic!(),
   |         ^^^^^^^ constant of non-structural type
   |
   = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details

error: aborting due to 1 previous error