error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/consts-opaque.rs:31: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:38: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:46: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:54: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:62: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:71: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:73: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:81: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:91: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:98: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:33: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:40: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:54:9 | LL | Bar => {} | --- matches any value LL | BAR => {} // should not be emitting unreachable warning | ^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:57:9 | LL | Bar => {} | --- matches any value ... LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:64:9 | LL | BAR => {} | --- matches any value LL | LL | Bar => {} // should not be emitting unreachable warning | ^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:66:9 | LL | BAR => {} | --- matches any value ... LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:73:9 | LL | BAR => {} | --- matches any value LL | LL | BAR => {} // should not be emitting unreachable warning | ^^^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:76:9 | LL | BAR => {} | --- matches any value ... LL | _ => {} // should not be emitting unreachable warning | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:83: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:85:9 | LL | BAZ => {} | --- matches any value ... LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:93:9 | LL | BAZ => {} | --- matches any value LL | LL | _ => {} | ^ unreachable pattern error: unreachable pattern --> $DIR/consts-opaque.rs:100: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:102:9 | LL | BAZ => {} | --- matches any value ... LL | _ => {} // should not be emitting unreachable warning | ^ unreachable pattern error[E0004]: non-exhaustive patterns: `Wrap(_)` not covered --> $DIR/consts-opaque.rs:135:11 | LL | match WRAPQUUX { | ^^^^^^^^ pattern `Wrap(_)` not covered | note: `Wrap usize>` defined here --> $DIR/consts-opaque.rs:117:12 | LL | struct Wrap(T); | ^^^^ = note: the matched value is of type `Wrap usize>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ WRAPQUUX => {}, LL + Wrap(_) => todo!() | error: aborting due to 23 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0004`.