Files
rust/tests/ui/consts/const_in_pattern/no-eq-branch-fail.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
537 B
Plaintext
Raw Normal View History

error: constant of non-structural type `Foo` in a pattern
--> $DIR/no-eq-branch-fail.rs:19:9
2020-04-07 12:11:29 -07:00
|
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
...
2020-04-07 12:11:29 -07:00
LL | BAR_BAZ => panic!(),
| ^^^^^^^ constant of non-structural type
|
2023-09-26 09:39:41 +02:00
= note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
2020-04-07 12:11:29 -07:00
error: aborting due to 1 previous error
2020-04-07 12:11:29 -07:00