Files
rust/tests/ui/consts/const_in_pattern/cross-crate-fail.stderr

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

35 lines
1.3 KiB
Plaintext
Raw Normal View History

error: constant of non-structural type `CustomEq` in a pattern
--> $DIR/cross-crate-fail.rs:11:9
2020-04-07 13:01:41 -07:00
|
LL | consts::SOME => panic!(),
| ^^^^^^^^^^^^ constant of non-structural type
|
::: $DIR/auxiliary/consts.rs:1:1
|
LL | pub struct CustomEq;
| ------------------- `CustomEq` must be annotated with `#[derive(PartialEq)]` to be usable in patterns
...
LL | pub const SOME: Option<CustomEq> = Some(CustomEq);
| -------------------------------- constant defined here
|
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 13:01:41 -07:00
error: constant of non-structural type `CustomEq` in a pattern
--> $DIR/cross-crate-fail.rs:17:9
|
LL | <Defaulted as consts::AssocConst>::SOME => panic!(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant of non-structural type
|
::: $DIR/auxiliary/consts.rs:1:1
|
LL | pub struct CustomEq;
| ------------------- `CustomEq` must be annotated with `#[derive(PartialEq)]` to be usable in patterns
...
LL | const SOME: Option<CustomEq> = Some(CustomEq);
| ---------------------------- constant defined here
|
2023-09-26 09:39:41 +02:00
= note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
error: aborting due to 2 previous errors
2020-04-07 13:01:41 -07:00