1+ warning: irrefutable `if let` pattern
2+ --> $DIR/match-cfg-fake-edges.rs:19:8
3+ |
4+ LL | if let _ = true {
5+ | ^^^^^^^^^^^^
6+ |
7+ = note: this pattern will always match, so the `if let` is useless
8+ = help: consider replacing the `if let` with a `let`
9+ = note: `#[warn(irrefutable_let_patterns)]` on by default
10+
111error[E0382]: use of moved value: `x`
212 --> $DIR/match-cfg-fake-edges.rs:16:10
313 |
@@ -15,8 +25,25 @@ help: consider cloning the value if the performance cost is acceptable
1525LL | _ => drop(x.clone()),
1626 | ++++++++
1727
28+ error[E0382]: use of moved value: `x`
29+ --> $DIR/match-cfg-fake-edges.rs:24:10
30+ |
31+ LL | let x = String::new();
32+ | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
33+ ...
34+ LL | drop(x)
35+ | - value moved here
36+ ...
37+ LL | drop(x);
38+ | ^ value used here after move
39+ |
40+ help: consider cloning the value if the performance cost is acceptable
41+ |
42+ LL | drop(x.clone())
43+ | ++++++++
44+
1845error[E0382]: borrow of moved value: `x.0`
19- --> $DIR/match-cfg-fake-edges.rs:22 :5
46+ --> $DIR/match-cfg-fake-edges.rs:30 :5
2047 |
2148LL | (y, _) | (_, y) => (),
2249 | - value moved here
@@ -31,7 +58,7 @@ LL | (ref y, _) | (_, y) => (),
3158 | +++
3259
3360error[E0382]: borrow of moved value: `x.1`
34- --> $DIR/match-cfg-fake-edges.rs:24 :5
61+ --> $DIR/match-cfg-fake-edges.rs:32 :5
3562 |
3663LL | (y, _) | (_, y) => (),
3764 | - value moved here
@@ -45,8 +72,37 @@ help: borrow this binding in the pattern to avoid moving the value
4572LL | (y, _) | (_, ref y) => (),
4673 | +++
4774
75+ error[E0382]: borrow of moved value: `x.0`
76+ --> $DIR/match-cfg-fake-edges.rs:36:5
77+ |
78+ LL | let ((y, _) | (_, y)) = x;
79+ | - value moved here
80+ LL | &x.0;
81+ | ^^^^ value borrowed here after move
82+ |
83+ = note: move occurs because `x.0` has type `String`, which does not implement the `Copy` trait
84+ help: borrow this binding in the pattern to avoid moving the value
85+ |
86+ LL | let ((ref y, _) | (_, y)) = x;
87+ | +++
88+
89+ error[E0382]: borrow of moved value: `x.1`
90+ --> $DIR/match-cfg-fake-edges.rs:38:5
91+ |
92+ LL | let ((y, _) | (_, y)) = x;
93+ | - value moved here
94+ ...
95+ LL | &x.1;
96+ | ^^^^ value borrowed here after move
97+ |
98+ = note: move occurs because `x.1` has type `String`, which does not implement the `Copy` trait
99+ help: borrow this binding in the pattern to avoid moving the value
100+ |
101+ LL | let ((y, _) | (_, ref y)) = x;
102+ | +++
103+
48104error[E0381]: used binding `x` is possibly-uninitialized
49- --> $DIR/match-cfg-fake-edges.rs:58 :19
105+ --> $DIR/match-cfg-fake-edges.rs:72 :19
50106 |
51107LL | let x;
52108 | - binding declared here but left uninitialized
@@ -57,7 +113,7 @@ LL | _ => drop(x),
57113 | if this pattern is matched, `x` is not initialized
58114
59115error[E0381]: used binding `x` isn't initialized
60- --> $DIR/match-cfg-fake-edges.rs:65 :16
116+ --> $DIR/match-cfg-fake-edges.rs:79 :16
61117 |
62118LL | let x;
63119 | - binding declared here but left uninitialized
@@ -74,7 +130,7 @@ LL | let x = 0;
74130 | +++
75131
76132error[E0381]: used binding `x` isn't initialized
77- --> $DIR/match-cfg-fake-edges.rs:72 :31
133+ --> $DIR/match-cfg-fake-edges.rs:86 :31
78134 |
79135LL | let x;
80136 | - binding declared here but left uninitialized
@@ -90,7 +146,7 @@ LL | let x = 0;
90146 | +++
91147
92148error[E0382]: use of moved value: `x`
93- --> $DIR/match-cfg-fake-edges.rs:85 :22
149+ --> $DIR/match-cfg-fake-edges.rs:99 :22
94150 |
95151LL | let x = String::new();
96152 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
@@ -107,7 +163,7 @@ LL | false if { drop(x.clone()); true } => {},
107163 | ++++++++
108164
109165error[E0382]: use of moved value: `x`
110- --> $DIR/match-cfg-fake-edges.rs:100 :22
166+ --> $DIR/match-cfg-fake-edges.rs:114 :22
111167 |
112168LL | let x = String::new();
113169 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
@@ -122,7 +178,7 @@ help: consider cloning the value if the performance cost is acceptable
122178LL | false if let Some(()) = { drop(x.clone()); Some(()) } => {},
123179 | ++++++++
124180
125- error: aborting due to 8 previous errors
181+ error: aborting due to 11 previous errors; 1 warning emitted
126182
127183Some errors have detailed explanations: E0381, E0382.
128184For more information about an error, try `rustc --explain E0381`.
0 commit comments