rust/tests/ui/pattern/usefulness/issue-85222-types-containin...

163 lines
6.9 KiB
Plaintext

error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:8:11
|
LL | match 0 {
| ^ pattern `usize::MAX..` not covered
|
= note: the matched value is of type `usize`
= note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
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 ~ 1..=usize::MAX => (),
LL ~ usize::MAX.. => todo!(),
|
error[E0004]: non-exhaustive patterns: `(usize::MAX.., _)` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:14:11
|
LL | match (0usize, 0usize) {
| ^^^^^^^^^^^^^^^^ pattern `(usize::MAX.., _)` not covered
|
= note: the matched value is of type `(usize, usize)`
= note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
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 ~ (1..=usize::MAX, 1..=usize::MAX) => (),
LL ~ (usize::MAX.., _) => todo!(),
|
error[E0004]: non-exhaustive patterns: `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:20:11
|
LL | match (0isize, 0usize) {
| ^^^^^^^^^^^^^^^^ patterns `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
|
= note: the matched value is of type `(isize, usize)`
= note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ (isize::MIN..=isize::MAX, 1..=usize::MAX) => (),
LL ~ (..isize::MIN, _) | (isize::MAX.., _) => todo!(),
|
error[E0004]: non-exhaustive patterns: `Some(_)` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:27:11
|
LL | match Some(1usize) {
| ^^^^^^^^^^^^ pattern `Some(_)` not covered
|
note: `Option<usize>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<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 ~ None => {},
LL + Some(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `Some(usize::MAX..)` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:32:11
|
LL | match Some(4) {
| ^^^^^^^ pattern `Some(usize::MAX..)` not covered
|
note: `Option<usize>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<usize>`
= note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
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 ~ None => (),
LL ~ Some(usize::MAX..) => todo!(),
|
error[E0004]: non-exhaustive patterns: `Some(Some(Some(usize::MAX..)))` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:39:11
|
LL | match Some(Some(Some(0))) {
| ^^^^^^^^^^^^^^^^^^^ pattern `Some(Some(Some(usize::MAX..)))` not covered
|
note: `Option<Option<Option<usize>>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
|
= note: not covered
|
= note: not covered
= note: the matched value is of type `Option<Option<Option<usize>>>`
= note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
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 ~ None => (),
LL ~ Some(Some(Some(usize::MAX..))) => todo!(),
|
error[E0004]: non-exhaustive patterns: `A { a: usize::MAX.. }` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:48:11
|
LL | match (A { a: 0usize }) {
| ^^^^^^^^^^^^^^^^^ pattern `A { a: usize::MAX.. }` not covered
|
note: `A<usize>` defined here
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:1:8
|
LL | struct A<T> {
| ^
= note: the matched value is of type `A<usize>`
= note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
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 ~ A { a: 1..=usize::MAX } => (),
LL ~ A { a: usize::MAX.. } => todo!(),
|
error[E0004]: non-exhaustive patterns: `B(..isize::MIN, _)` and `B(isize::MAX.., _)` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:54:11
|
LL | match B(0isize, 0usize) {
| ^^^^^^^^^^^^^^^^^ patterns `B(..isize::MIN, _)` and `B(isize::MAX.., _)` not covered
|
note: `B<isize, usize>` defined here
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:5:8
|
LL | struct B<T, U>(T, U);
| ^
= note: the matched value is of type `B<isize, usize>`
= note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ B(isize::MIN..=isize::MAX, 1..=usize::MAX) => (),
LL ~ B(..isize::MIN, _) | B(isize::MAX.., _) => todo!(),
|
error[E0004]: non-exhaustive patterns: `B(_, usize::MAX..)` not covered
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:62:11
|
LL | match B(0isize, 0usize) {
| ^^^^^^^^^^^^^^^^^ pattern `B(_, usize::MAX..)` not covered
|
note: `B<isize, usize>` defined here
--> $DIR/issue-85222-types-containing-non-exhaustive-types.rs:5:8
|
LL | struct B<T, U>(T, U);
| ^
= note: the matched value is of type `B<isize, usize>`
= note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
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 ~ B(_, 1..=usize::MAX) => (),
LL ~ B(_, usize::MAX..) => todo!(),
|
error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0004`.