Accidentally fixed #78071

This commit is contained in:
Nadrieril 2020-10-20 00:06:00 +01:00
parent c4ae6c2bb9
commit 5bfd3e7259
2 changed files with 40 additions and 28 deletions

View file

@ -44,11 +44,13 @@ fn main() {
//~^ ERROR unreachable pattern
}
// FIXME: this causes an ICE (https://github.com/rust-lang/rust/issues/78071)
//match FOO_REF_REF {
// FOO_REF_REF => {}
// Foo(_) => {}
//}
// This used to cause an ICE (https://github.com/rust-lang/rust/issues/78071)
match FOO_REF_REF {
FOO_REF_REF => {}
//~^ WARNING must be annotated with `#[derive(PartialEq, Eq)]`
//~| WARNING this was previously accepted by the compiler but is being phased out
Foo(_) => {}
}
match BAR {
Bar => {}

View file

@ -28,14 +28,24 @@ error: unreachable pattern
LL | Foo(_) => {} // should not be emitting unreachable warning
| ^^^^^^
warning: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:49:9
|
LL | FOO_REF_REF => {}
| ^^^^^^^^^^^
|
= note: `#[warn(indirect_structural_match)]` on by default
= 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>
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:55:9
--> $DIR/consts-opaque.rs:57:9
|
LL | BAR => {} // should not be emitting unreachable warning
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:55:9
--> $DIR/consts-opaque.rs:57:9
|
LL | Bar => {}
| --- matches any value
@ -43,7 +53,7 @@ LL | BAR => {} // should not be emitting unreachable warning
| ^^^ unreachable pattern
error: unreachable pattern
--> $DIR/consts-opaque.rs:58:9
--> $DIR/consts-opaque.rs:60:9
|
LL | Bar => {}
| --- matches any value
@ -52,19 +62,19 @@ LL | _ => {}
| ^ unreachable pattern
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:63:9
--> $DIR/consts-opaque.rs:65:9
|
LL | BAR => {}
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:65:9
--> $DIR/consts-opaque.rs:67:9
|
LL | Bar => {} // should not be emitting unreachable warning
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:67:9
--> $DIR/consts-opaque.rs:69:9
|
LL | Bar => {} // should not be emitting unreachable warning
| --- matches any value
@ -73,76 +83,76 @@ LL | _ => {}
| ^ unreachable pattern
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
--> $DIR/consts-opaque.rs:74:9
|
LL | BAR => {}
| ^^^
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:74:9
--> $DIR/consts-opaque.rs:76:9
|
LL | BAR => {} // should not be emitting unreachable warning
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:74:9
--> $DIR/consts-opaque.rs:76:9
|
LL | BAR => {} // should not be emitting unreachable warning
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:77:9
--> $DIR/consts-opaque.rs:79:9
|
LL | _ => {} // should not be emitting unreachable warning
| ^
error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:82:9
--> $DIR/consts-opaque.rs:84:9
|
LL | BAZ => {}
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:84:9
--> $DIR/consts-opaque.rs:86:9
|
LL | Baz::Baz1 => {} // should not be emitting unreachable warning
| ^^^^^^^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:86:9
--> $DIR/consts-opaque.rs:88:9
|
LL | _ => {}
| ^
error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:92:9
|
LL | BAZ => {}
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:94:9
|
LL | BAZ => {}
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:96:9
|
LL | _ => {}
| ^
error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:99:9
--> $DIR/consts-opaque.rs:101:9
|
LL | BAZ => {}
| ^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:101:9
--> $DIR/consts-opaque.rs:103:9
|
LL | Baz::Baz2 => {} // should not be emitting unreachable warning
| ^^^^^^^^^
error: unreachable pattern
--> $DIR/consts-opaque.rs:103:9
--> $DIR/consts-opaque.rs:105:9
|
LL | _ => {} // should not be emitting unreachable warning
| ^
error: aborting due to 22 previous errors
error: aborting due to 22 previous errors; 1 warning emitted