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
+
1
11
error[E0382]: use of moved value: `x`
2
12
--> $DIR/match-cfg-fake-edges.rs:16:10
3
13
|
@@ -15,8 +25,25 @@ help: consider cloning the value if the performance cost is acceptable
15
25
LL | _ => drop(x.clone()),
16
26
| ++++++++
17
27
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
+
18
45
error[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
20
47
|
21
48
LL | (y, _) | (_, y) => (),
22
49
| - value moved here
@@ -31,7 +58,7 @@ LL | (ref y, _) | (_, y) => (),
31
58
| +++
32
59
33
60
error[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
35
62
|
36
63
LL | (y, _) | (_, y) => (),
37
64
| - value moved here
@@ -45,8 +72,37 @@ help: borrow this binding in the pattern to avoid moving the value
45
72
LL | (y, _) | (_, ref y) => (),
46
73
| +++
47
74
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
+
48
104
error[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
50
106
|
51
107
LL | let x;
52
108
| - binding declared here but left uninitialized
@@ -57,7 +113,7 @@ LL | _ => drop(x),
57
113
| if this pattern is matched, `x` is not initialized
58
114
59
115
error[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
61
117
|
62
118
LL | let x;
63
119
| - binding declared here but left uninitialized
@@ -74,7 +130,7 @@ LL | let x = 0;
74
130
| +++
75
131
76
132
error[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
78
134
|
79
135
LL | let x;
80
136
| - binding declared here but left uninitialized
@@ -90,7 +146,7 @@ LL | let x = 0;
90
146
| +++
91
147
92
148
error[E0382]: use of moved value: `x`
93
- --> $DIR/match-cfg-fake-edges.rs:85 :22
149
+ --> $DIR/match-cfg-fake-edges.rs:99 :22
94
150
|
95
151
LL | let x = String::new();
96
152
| - 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 } => {},
107
163
| ++++++++
108
164
109
165
error[E0382]: use of moved value: `x`
110
- --> $DIR/match-cfg-fake-edges.rs:100 :22
166
+ --> $DIR/match-cfg-fake-edges.rs:114 :22
111
167
|
112
168
LL | let x = String::new();
113
169
| - 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
122
178
LL | false if let Some(()) = { drop(x.clone()); Some(()) } => {},
123
179
| ++++++++
124
180
125
- error: aborting due to 8 previous errors
181
+ error: aborting due to 11 previous errors; 1 warning emitted
126
182
127
183
Some errors have detailed explanations: E0381, E0382.
128
184
For more information about an error, try `rustc --explain E0381`.
0 commit comments