blob: 637c9ff686bdb4d7b1247120772d17a9ee95bd6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
error: this let-binding has unit value
--> tests/ui/let_unit.rs:11:5
|
LL | let _x = println!("x");
| ^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `println!("x");`
|
= note: `-D clippy::let-unit-value` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::let_unit_value)]`
error: this let-binding has unit value
--> tests/ui/let_unit.rs:60:5
|
LL | / let _ = v
LL | |
LL | | .into_iter()
LL | | .map(|i| i * 2)
... |
LL | | .next()
LL | | .unwrap();
| |__________________^
|
help: omit the `let` binding
|
LL ~ v
LL +
LL + .into_iter()
LL + .map(|i| i * 2)
LL + .filter(|i| i.is_multiple_of(2))
LL + .map(|_| ())
LL + .next()
LL + .unwrap();
|
error: this let-binding has unit value
--> tests/ui/let_unit.rs:110:5
|
LL | / let x = match Some(0) {
LL | |
LL | | None => f2(1),
LL | | Some(0) => f(),
LL | | Some(1) => f2(3),
LL | | Some(_) => (),
LL | | };
| |______^
|
help: omit the `let` binding
|
LL ~ match Some(0) {
LL +
LL + None => f2(1),
LL + Some(0) => f(),
LL + Some(1) => f2(3),
LL + Some(_) => (),
LL + };
|
error: this let-binding has unit value
--> tests/ui/let_unit.rs:192:9
|
LL | let res = returns_unit();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: omit the `let` binding and replace variable usages with `()`
|
LL ~ returns_unit();
LL |
LL ~ returns_result(()).unwrap();
LL ~ returns_result(()).unwrap();
|
error: this let-binding has unit value
--> tests/ui/let_unit.rs:206:5
|
LL | let res = return_unit();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: replace variable usages with `()`
|
LL ~ let res = ();
LL ~ return_unit();
LL |
LL ~ do_something(());
|
error: aborting due to 5 previous errors
|