rust/tests/ui/pattern/usefulness/consts-opaque.stderr

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

203 lines
5.7 KiB
Plaintext
Raw Normal View History

2020-10-17 13:01:10 -05:00
error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:30:9
2020-10-17 13:01:10 -05:00
|
LL | FOO => {}
| ^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:32:9
2020-10-17 13:01:10 -05:00
|
LL | FOO => {}
| --- matches any value
LL |
2020-10-17 13:01:10 -05:00
LL | _ => {} // should not be emitting unreachable warning
| ^ unreachable pattern
2020-10-17 13:01:10 -05:00
|
note: the lint level is defined here
--> $DIR/consts-opaque.rs:6:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:37:9
2020-10-17 13:01:10 -05:00
|
LL | FOO_REF => {}
| ^^^^^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:39:9
2020-10-17 13:01:10 -05:00
|
LL | FOO_REF => {}
| ------- matches any value
LL |
2020-10-17 13:01:10 -05:00
LL | Foo(_) => {} // should not be emitting unreachable warning
| ^^^^^^ unreachable pattern
2020-10-17 13:01:10 -05:00
2020-10-19 18:06:00 -05:00
warning: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:45:9
2020-10-19 18:06:00 -05:00
|
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>
2022-09-18 10:55:36 -05:00
= note: `#[warn(indirect_structural_match)]` on by default
2020-10-19 18:06:00 -05:00
2020-10-17 13:01:10 -05:00
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:53:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {} // should not be emitting unreachable warning
| ^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:53:9
2020-10-17 13:01:10 -05:00
|
LL | Bar => {}
| --- matches any value
LL | BAR => {} // should not be emitting unreachable warning
| ^^^ unreachable pattern
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:56:9
2020-10-17 13:01:10 -05:00
|
LL | Bar => {}
| --- matches any value
...
LL | _ => {}
| ^ unreachable pattern
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:61:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {}
| ^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:63:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {}
| --- matches any value
LL |
2020-10-17 13:01:10 -05:00
LL | Bar => {} // should not be emitting unreachable warning
| ^^^ unreachable pattern
2020-10-17 13:01:10 -05:00
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:65:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {}
2020-10-17 13:01:10 -05:00
| --- matches any value
...
2020-10-17 13:01:10 -05:00
LL | _ => {}
| ^ unreachable pattern
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:70:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {}
| ^^^
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:72:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {} // should not be emitting unreachable warning
| ^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:72:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {}
| --- matches any value
LL |
2020-10-17 13:01:10 -05:00
LL | BAR => {} // should not be emitting unreachable warning
| ^^^ unreachable pattern
2020-10-17 13:01:10 -05:00
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:75:9
2020-10-17 13:01:10 -05:00
|
LL | BAR => {}
| --- matches any value
...
2020-10-17 13:01:10 -05:00
LL | _ => {} // should not be emitting unreachable warning
| ^ unreachable pattern
2020-10-17 13:01:10 -05:00
error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:80:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| ^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:82:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| --- matches any value
LL |
2020-10-17 13:01:10 -05:00
LL | Baz::Baz1 => {} // should not be emitting unreachable warning
| ^^^^^^^^^ unreachable pattern
2020-10-17 13:01:10 -05:00
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:84:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| --- matches any value
...
2020-10-17 13:01:10 -05:00
LL | _ => {}
| ^ unreachable pattern
2020-10-17 13:01:10 -05:00
error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:90:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| ^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:92:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| --- matches any value
LL |
2020-10-17 13:01:10 -05:00
LL | _ => {}
| ^ unreachable pattern
2020-10-17 13:01:10 -05:00
error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:97:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| ^^^
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:99:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| --- matches any value
LL |
2020-10-17 13:01:10 -05:00
LL | Baz::Baz2 => {} // should not be emitting unreachable warning
| ^^^^^^^^^ unreachable pattern
2020-10-17 13:01:10 -05:00
error: unreachable pattern
2020-11-14 15:50:53 -06:00
--> $DIR/consts-opaque.rs:101:9
2020-10-17 13:01:10 -05:00
|
LL | BAZ => {}
| --- matches any value
...
2020-10-17 13:01:10 -05:00
LL | _ => {} // should not be emitting unreachable warning
| ^ unreachable pattern
2020-10-17 13:01:10 -05:00
2020-11-14 15:50:53 -06:00
error: unreachable pattern
--> $DIR/consts-opaque.rs:127:9
|
LL | Wrap(_) => {}
| ------- matches any value
2020-11-14 15:50:53 -06:00
LL | WRAPQUUX => {} // detected unreachable because we do inspect the `Wrap` layer
| ^^^^^^^^ unreachable pattern
2020-11-14 15:50:53 -06:00
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
2020-10-17 13:01:10 -05:00