mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
d1fd11f3f9
Means you'll get more `non-exhaustive` patterns
138 lines
5.1 KiB
Plaintext
138 lines
5.1 KiB
Plaintext
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: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:44: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 <https://github.com/rust-lang/rust/issues/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:52: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:59: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:67: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:69: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 `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
|
|
--> $DIR/consts-opaque.rs:75: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:83: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:89: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:54:9
|
|
|
|
|
LL | Bar => {}
|
|
| --- matches any value
|
|
...
|
|
LL | _ => {}
|
|
| ^ 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:62:9
|
|
|
|
|
LL | Bar => {}
|
|
| --- matches any value
|
|
LL | _ => {}
|
|
| ^ unreachable pattern
|
|
|
|
error[E0004]: non-exhaustive patterns: `Wrap(_)` not covered
|
|
--> $DIR/consts-opaque.rs:124:11
|
|
|
|
|
LL | match WRAPQUUX {
|
|
| ^^^^^^^^ pattern `Wrap(_)` not covered
|
|
|
|
|
note: `Wrap<fn(usize, usize) -> usize>` defined here
|
|
--> $DIR/consts-opaque.rs:106:12
|
|
|
|
|
LL | struct Wrap<T>(T);
|
|
| ^^^^
|
|
= note: the matched value is of type `Wrap<fn(usize, usize) -> 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 12 previous errors; 1 warning emitted
|
|
|
|
For more information about this error, try `rustc --explain E0004`.
|