]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/let_unit.stderr
Rollup merge of #96939 - GuillaumeGomez:settings-css, r=notriddle
[rust.git] / src / tools / clippy / tests / ui / let_unit.stderr
1 error: this let-binding has unit value
2   --> $DIR/let_unit.rs:14:5
3    |
4 LL |     let _x = println!("x");
5    |     ^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `println!("x");`
6    |
7    = note: `-D clippy::let-unit-value` implied by `-D warnings`
8
9 error: this let-binding has unit value
10   --> $DIR/let_unit.rs:18:9
11    |
12 LL |         let _a = ();
13    |         ^^^^^^^^^^^^ help: omit the `let` binding: `();`
14
15 error: this let-binding has unit value
16   --> $DIR/let_unit.rs:53:5
17    |
18 LL | /     let _ = v
19 LL | |         .into_iter()
20 LL | |         .map(|i| i * 2)
21 LL | |         .filter(|i| i % 2 == 0)
22 LL | |         .map(|_| ())
23 LL | |         .next()
24 LL | |         .unwrap();
25    | |__________________^
26    |
27 help: omit the `let` binding
28    |
29 LL ~     v
30 LL +         .into_iter()
31 LL +         .map(|i| i * 2)
32 LL +         .filter(|i| i % 2 == 0)
33 LL +         .map(|_| ())
34 LL +         .next()
35  ...
36
37 error: this let-binding has unit value
38   --> $DIR/let_unit.rs:80:5
39    |
40 LL |     let x: () = f(); // Lint.
41    |     ^^^^-^^^^^^^^^^^
42    |         |
43    |         help: use a wild (`_`) binding: `_`
44
45 error: this let-binding has unit value
46   --> $DIR/let_unit.rs:83:5
47    |
48 LL |     let x: () = f2(0i32); // Lint.
49    |     ^^^^-^^^^^^^^^^^^^^^^
50    |         |
51    |         help: use a wild (`_`) binding: `_`
52
53 error: this let-binding has unit value
54   --> $DIR/let_unit.rs:85:5
55    |
56 LL |     let _: () = f3(()); // Lint
57    |     ^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f3(());`
58
59 error: this let-binding has unit value
60   --> $DIR/let_unit.rs:86:5
61    |
62 LL |     let x: () = f3(()); // Lint
63    |     ^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f3(());`
64
65 error: this let-binding has unit value
66   --> $DIR/let_unit.rs:88:5
67    |
68 LL |     let _: () = f4(vec![()]); // Lint
69    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f4(vec![()]);`
70
71 error: this let-binding has unit value
72   --> $DIR/let_unit.rs:89:5
73    |
74 LL |     let x: () = f4(vec![()]); // Lint
75    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f4(vec![()]);`
76
77 error: this let-binding has unit value
78   --> $DIR/let_unit.rs:98:5
79    |
80 LL |     let x: () = if true { f() } else { f2(0) }; // Lint
81    |     ^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82    |         |
83    |         help: use a wild (`_`) binding: `_`
84
85 error: this let-binding has unit value
86   --> $DIR/let_unit.rs:109:5
87    |
88 LL | /     let _: () = match Some(0) {
89 LL | |         None => f2(1),
90 LL | |         Some(0) => f(),
91 LL | |         Some(1) => f2(3),
92 LL | |         Some(_) => (),
93 LL | |     };
94    | |______^
95    |
96 help: omit the `let` binding
97    |
98 LL ~     match Some(0) {
99 LL +         None => f2(1),
100 LL +         Some(0) => f(),
101 LL +         Some(1) => f2(3),
102 LL +         Some(_) => (),
103 LL +     };
104    |
105
106 error: aborting due to 11 previous errors
107