]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/let_unit.stderr
Rollup merge of #95534 - jyn514:std-mem-copy, r=joshtriplett
[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 LL +         .unwrap();
36    |
37
38 error: this let-binding has unit value
39   --> $DIR/let_unit.rs:80:5
40    |
41 LL |     let x: () = f(); // Lint.
42    |     ^^^^-^^^^^^^^^^^
43    |         |
44    |         help: use a wild (`_`) binding: `_`
45
46 error: this let-binding has unit value
47   --> $DIR/let_unit.rs:83:5
48    |
49 LL |     let x: () = f2(0i32); // Lint.
50    |     ^^^^-^^^^^^^^^^^^^^^^
51    |         |
52    |         help: use a wild (`_`) binding: `_`
53
54 error: this let-binding has unit value
55   --> $DIR/let_unit.rs:85:5
56    |
57 LL |     let _: () = f3(()); // Lint
58    |     ^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f3(());`
59
60 error: this let-binding has unit value
61   --> $DIR/let_unit.rs:86:5
62    |
63 LL |     let x: () = f3(()); // Lint
64    |     ^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f3(());`
65
66 error: this let-binding has unit value
67   --> $DIR/let_unit.rs:88:5
68    |
69 LL |     let _: () = f4(vec![()]); // Lint
70    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f4(vec![()]);`
71
72 error: this let-binding has unit value
73   --> $DIR/let_unit.rs:89:5
74    |
75 LL |     let x: () = f4(vec![()]); // Lint
76    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f4(vec![()]);`
77
78 error: this let-binding has unit value
79   --> $DIR/let_unit.rs:98:5
80    |
81 LL |     let x: () = if true { f() } else { f2(0) }; // Lint
82    |     ^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83    |         |
84    |         help: use a wild (`_`) binding: `_`
85
86 error: this let-binding has unit value
87   --> $DIR/let_unit.rs:109:5
88    |
89 LL | /     let _: () = match Some(0) {
90 LL | |         None => f2(1),
91 LL | |         Some(0) => f(),
92 LL | |         Some(1) => f2(3),
93 LL | |         Some(_) => (),
94 LL | |     };
95    | |______^
96    |
97 help: omit the `let` binding
98    |
99 LL ~     match Some(0) {
100 LL +         None => f2(1),
101 LL +         Some(0) => f(),
102 LL +         Some(1) => f2(3),
103 LL +         Some(_) => (),
104 LL +     };
105    |
106
107 error: aborting due to 11 previous errors
108