error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:30:9 | LL | FOO => {} | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:37:9 | LL | FOO_REF => {} | ^^^^^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details warning: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:45:9 | LL | FOO_REF_REF => {} | ^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #62411 = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details = note: `#[warn(indirect_structural_match)]` on by default error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:53:9 | LL | BAR => {} // should not be emitting unreachable warning | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:61:9 | LL | BAR => {} | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:70:9 | LL | BAR => {} | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:72:9 | LL | BAR => {} // should not be emitting unreachable warning | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:80:9 | LL | BAZ => {} | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:90:9 | LL | BAZ => {} | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:97:9 | LL | BAZ => {} | ^^^ | = note: the traits must be derived, manual `impl`s are not sufficient = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details error: unreachable pattern --> $DIR/consts-opaque.rs:32:9 | LL | FOO => {} | --- matches any value LL | LL | _ => {} // should not be emitting unreachable warning | ^ unreachable pattern | note: the lint level is defined here --> $DIR/consts-opaque.rs:6:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern --> $DIR/consts-opaque.rs:39:9 | LL | FOO_REF => {} | ------- matches any value LL | LL | Foo(_) => {} // should not be emitting unreachable warning | ^^^^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:53:9 | LL | Bar => {} | --- matches any value LL | BAR => {} // should not be emitting unreachable warning | ^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:56:9 | LL | Bar => {} | --- matches any value ... LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:63:9 | LL | BAR => {} | --- matches any value LL | LL | Bar => {} // should not be emitting unreachable warning | ^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:65:9 | LL | BAR => {} | --- matches any value ... LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:72:9 | LL | BAR => {} | --- matches any value LL | LL | BAR => {} // should not be emitting unreachable warning | ^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:75:9 | LL | BAR => {} | --- matches any value ... LL | _ => {} // should not be emitting unreachable warning | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:82:9 | LL | BAZ => {} | --- matches any value LL | LL | Baz::Baz1 => {} // should not be emitting unreachable warning | ^^^^^^^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:84:9 | LL | BAZ => {} | --- matches any value ... LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:92:9 | LL | BAZ => {} | --- matches any value LL | LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:99:9 | LL | BAZ => {} | --- matches any value LL | LL | Baz::Baz2 => {} // should not be emitting unreachable warning | ^^^^^^^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:101:9 | LL | BAZ => {} | --- matches any value ... LL | _ => {} // should not be emitting unreachable warning | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:127:9 | LL | Wrap(_) => {} | ------- matches any value LL | WRAPQUUX => {} // detected unreachable because we do inspect the `Wrap` layer | ^^^^^^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:141:9 | LL | WHOKNOWSQUUX => {} // detected unreachable because we do inspect the `WhoKnows` layer | ^^^^^^^^^^^^ error: aborting due to 24 previous errors; 1 warning emitted