fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.6 KiB71 linesraw
1error[E0004]: non-exhaustive patterns: `L1::B` not covered
2  --> $DIR/non-exhaustive-match.rs:26:25
3   |
4LL |     let _b = || { match l1 { L1::A => () } };
5   |                         ^^ pattern `L1::B` not covered
6   |
7note: `L1` defined here
8  --> $DIR/non-exhaustive-match.rs:12:14
9   |
10LL | enum L1 { A, B }
11   |      --      ^ not covered
12   = note: the matched value is of type `L1`
13help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
14   |
15LL |     let _b = || { match l1 { L1::A => (), L1::B => todo!() } };
16   |                                         ++++++++++++++++++
17
18error[E0004]: non-exhaustive patterns: type `E1` is non-empty
19  --> $DIR/non-exhaustive-match.rs:37:25
20   |
21LL |     let _d = || { match e1 {} };
22   |                         ^^
23   |
24note: `E1` defined here
25  --> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
26   |
27LL | pub enum E1 {}
28   | ^^^^^^^^^^^
29   = note: the matched value is of type `E1`, which is marked as non-exhaustive
30help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
31   |
32LL ~     let _d = || { match e1 {
33LL +         _ => todo!(),
34LL ~     } };
35   |
36
37error[E0004]: non-exhaustive patterns: `_` not covered
38  --> $DIR/non-exhaustive-match.rs:39:25
39   |
40LL |     let _e = || { match e2 { E2::A => (), E2::B => () } };
41   |                         ^^ pattern `_` not covered
42   |
43note: `E2` defined here
44  --> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
45   |
46LL | pub enum E2 { A, B }
47   | ^^^^^^^^^^^
48   = note: the matched value is of type `E2`
49   = note: `E2` is marked as non-exhaustive, so a wildcard `_` is necessary to match exhaustively
50help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
51   |
52LL |     let _e = || { match e2 { E2::A => (), E2::B => (), _ => todo!() } };
53   |                                                      ++++++++++++++
54
55error[E0505]: cannot move out of `e3` because it is borrowed
56  --> $DIR/non-exhaustive-match.rs:46:22
57   |
58LL |     let _g = || { match e3 { E3::C => (), _ => () }  };
59   |              --         -- borrow occurs due to use in closure
60   |              |
61   |              borrow of `e3` occurs here
62LL |     let mut mut_e3 = e3;
63   |                      ^^ move out of `e3` occurs here
64LL |
65LL |     _g();
66   |     -- borrow later used here
67
68error: aborting due to 4 previous errors
69
70Some errors have detailed explanations: E0004, E0505.
71For more information about an error, try `rustc --explain E0004`.