]> git.lizzy.rs Git - rust.git/blob - tests/ui/redundant_closure_call_fixable.stderr
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / redundant_closure_call_fixable.stderr
1 error: try not to call a closure in the expression where it is declared
2   --> $DIR/redundant_closure_call_fixable.rs:16:13
3    |
4 LL |     let a = (|| 42)();
5    |             ^^^^^^^^^ help: try doing something like: `42`
6    |
7    = note: `-D clippy::redundant-closure-call` implied by `-D warnings`
8
9 error: try not to call a closure in the expression where it is declared
10   --> $DIR/redundant_closure_call_fixable.rs:17:13
11    |
12 LL |       let b = (async || {
13    |  _____________^
14 LL | |         let x = something().await;
15 LL | |         let y = something_else().await;
16 LL | |         x * y
17 LL | |     })();
18    | |________^
19    |
20 help: try doing something like
21    |
22 LL ~     let b = async {
23 LL +         let x = something().await;
24 LL +         let y = something_else().await;
25 LL +         x * y
26 LL ~     };
27    |
28
29 error: try not to call a closure in the expression where it is declared
30   --> $DIR/redundant_closure_call_fixable.rs:22:13
31    |
32 LL |       let c = (|| {
33    |  _____________^
34 LL | |         let x = 21;
35 LL | |         let y = 2;
36 LL | |         x * y
37 LL | |     })();
38    | |________^
39    |
40 help: try doing something like
41    |
42 LL ~     let c = {
43 LL +         let x = 21;
44 LL +         let y = 2;
45 LL +         x * y
46 LL ~     };
47    |
48
49 error: try not to call a closure in the expression where it is declared
50   --> $DIR/redundant_closure_call_fixable.rs:27:13
51    |
52 LL |     let d = (async || something().await)();
53    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try doing something like: `async { something().await }`
54
55 error: aborting due to 4 previous errors
56