-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reveal opaque types in exhaustiveness checking
- Loading branch information
Showing
4 changed files
with
57 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,57 @@ | ||
error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty | ||
--> $DIR/impl-trait.rs:16:15 | ||
| | ||
LL | match return_never_rpit(x) {} | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the matched value is of type `impl Copy` | ||
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | ||
| | ||
LL ~ match return_never_rpit(x) { | ||
LL + _ => todo!(), | ||
LL + } | ||
| | ||
|
||
error[E0004]: non-exhaustive patterns: type `T` is non-empty | ||
--> $DIR/impl-trait.rs:29:15 | ||
| | ||
LL | match return_never_tait(x) {} | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the matched value is of type `T` | ||
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | ||
| | ||
LL ~ match return_never_tait(x) { | ||
LL + _ => todo!(), | ||
LL + } | ||
| | ||
|
||
error: unconstrained opaque type | ||
--> $DIR/impl-trait.rs:25:10 | ||
| | ||
LL | type T = impl Copy; | ||
| ^^^^^^^^^ | ||
| | ||
= note: `T` must be used in combination with a concrete type within the same module | ||
|
||
error[E0004]: non-exhaustive patterns: type `inner_never::T` is non-empty | ||
--> $DIR/impl-trait.rs:56:11 | ||
| | ||
LL | match y {} | ||
| ^ | ||
| | ||
= note: the matched value is of type `inner_never::T` | ||
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | ||
error: unreachable pattern | ||
--> $DIR/impl-trait.rs:41:13 | ||
| | ||
LL ~ match y { | ||
LL + _ => todo!(), | ||
LL + } | ||
LL | Some(_) => {} | ||
| ^^^^^^^ | ||
| | ||
|
||
error: unconstrained opaque type | ||
--> $DIR/impl-trait.rs:53:14 | ||
| | ||
LL | type T = impl Copy; | ||
| ^^^^^^^^^ | ||
note: the lint level is defined here | ||
--> $DIR/impl-trait.rs:5:9 | ||
| | ||
= note: `T` must be used in combination with a concrete type within the same item | ||
LL | #![deny(unreachable_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/impl-trait.rs:66:9 | ||
--> $DIR/impl-trait.rs:65:9 | ||
| | ||
LL | _ => {} | ||
| - matches any value | ||
LL | Some((a, b)) => {} | ||
| ^^^^^^^^^^^^ unreachable pattern | ||
|
||
error: unreachable pattern | ||
--> $DIR/impl-trait.rs:79:9 | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/impl-trait.rs:5:9 | ||
| | ||
LL | #![deny(unreachable_patterns)] | ||
LL | Some((mut x, mut y)) => { | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0004]: non-exhaustive patterns: type `U` is non-empty | ||
--> $DIR/impl-trait.rs:73:21 | ||
error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty | ||
--> $DIR/impl-trait.rs:21:11 | ||
| | ||
LL | if true { match u {} } else { x } | ||
| ^ | ||
LL | match return_never_rpit(x) {} | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the matched value is of type `U` | ||
= note: the matched value is of type `impl Copy` | ||
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | ||
| | ||
LL ~ if true { match u { | ||
LL ~ match return_never_rpit(x) { | ||
LL + _ => todo!(), | ||
LL ~ } } else { x } | ||
LL + } | ||
| | ||
|
||
error: unconstrained opaque type | ||
--> $DIR/impl-trait.rs:70:10 | ||
error[E0004]: non-exhaustive patterns: type `T` is non-empty | ||
--> $DIR/impl-trait.rs:33:11 | ||
| | ||
LL | type U = impl Copy; | ||
| ^^^^^^^^^ | ||
LL | match return_never_tait(x) {} | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `U` must be used in combination with a concrete type within the same module | ||
|
||
error: unreachable pattern | ||
--> $DIR/impl-trait.rs:82:9 | ||
= note: the matched value is of type `T` | ||
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown | ||
| | ||
LL ~ match return_never_tait(x) { | ||
LL + _ => todo!(), | ||
LL + } | ||
| | ||
LL | Some((mut x, mut y)) => { | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 9 previous errors | ||
error: aborting due to 5 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0004`. |