]> git.proxmox.com Git - rustc.git/blame - src/test/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / or-patterns / issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
CommitLineData
f035d41b 1error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
cdc7bbd5 2 --> $DIR/issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs:2:10
ba9703b0 3 |
6a06907d
XL
4LL | let (0 | (1 | 2)) = 0;
5 | ^^^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
ba9703b0
XL
6 |
7 = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8 = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
9 = note: the matched value is of type `i32`
5e7ed085 10help: you might want to use `if let` to ignore the variants that aren't matched
ba9703b0 11 |
5e7ed085
FG
12LL | if let (0 | (1 | 2)) = 0 { todo!() }
13 | ++ ~~~~~~~~~~~
ba9703b0 14
f035d41b 15error[E0004]: non-exhaustive patterns: `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
cdc7bbd5 16 --> $DIR/issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs:3:11
ba9703b0
XL
17 |
18LL | match 0 {
f035d41b 19 | ^ patterns `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
ba9703b0 20 |
ba9703b0 21 = note: the matched value is of type `i32`
5e7ed085
FG
22help: 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
23 |
24LL ~ 0 | (1 | 2) => {}
25LL + i32::MIN..=-1_i32 | 3_i32..=i32::MAX => todo!()
26 |
ba9703b0
XL
27
28error: aborting due to 2 previous errors
29
30Some errors have detailed explanations: E0004, E0005.
31For more information about an error, try `rustc --explain E0004`.