fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.1 KiB22 linesraw
1error[E0005]: refutable pattern in function argument: `(_, _)` not covered
2  --> $DIR/refutable-pattern-errors.rs:3:9
3   |
4LL | fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { }
5   |         ^^^^^^^^^^^^^^^^^^^^^ pattern `(_, _)` not covered
6
7error[E0005]: refutable pattern in local binding: `(std::i32::MIN..=0i32, _)` and `(2i32..=std::i32::MAX, _)` not covered
8  --> $DIR/refutable-pattern-errors.rs:7:9
9   |
10LL |     let (1, (Some(1), 2..=3)) = (1, (None, 2));
11   |         ^^^^^^^^^^^^^^^^^^^^^ patterns `(std::i32::MIN..=0i32, _)` and `(2i32..=std::i32::MAX, _)` not covered
12   |
13   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
14   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
15help: you might want to use `if let` to ignore the variant that isn't matched
16   |
17LL |     if let (1, (Some(1), 2..=3)) = (1, (None, 2)) { /* */ }
18   |
19
20error: aborting due to 2 previous errors
21
22For more information about this error, try `rustc --explain E0005`.