1
1
error: try not to call a closure in the expression where it is declared
2
- --> $DIR/redundant_closure_call_fixable.rs:16 :13
2
+ --> $DIR/redundant_closure_call_fixable.rs:17 :13
3
3
|
4
4
LL | let a = (|| 42)();
5
5
| ^^^^^^^^^ help: try doing something like: `42`
@@ -8,7 +8,7 @@ LL | let a = (|| 42)();
8
8
= help: to override `-D warnings` add `#[allow(clippy::redundant_closure_call)]`
9
9
10
10
error: try not to call a closure in the expression where it is declared
11
- --> $DIR/redundant_closure_call_fixable.rs:17 :13
11
+ --> $DIR/redundant_closure_call_fixable.rs:18 :13
12
12
|
13
13
LL | let b = (async || {
14
14
| _____________^
@@ -28,7 +28,7 @@ LL ~ };
28
28
|
29
29
30
30
error: try not to call a closure in the expression where it is declared
31
- --> $DIR/redundant_closure_call_fixable.rs:22 :13
31
+ --> $DIR/redundant_closure_call_fixable.rs:23 :13
32
32
|
33
33
LL | let c = (|| {
34
34
| _____________^
@@ -48,13 +48,13 @@ LL ~ };
48
48
|
49
49
50
50
error: try not to call a closure in the expression where it is declared
51
- --> $DIR/redundant_closure_call_fixable.rs:27 :13
51
+ --> $DIR/redundant_closure_call_fixable.rs:28 :13
52
52
|
53
53
LL | let d = (async || something().await)();
54
54
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try doing something like: `async { something().await }`
55
55
56
56
error: try not to call a closure in the expression where it is declared
57
- --> $DIR/redundant_closure_call_fixable.rs:36 :13
57
+ --> $DIR/redundant_closure_call_fixable.rs:37 :13
58
58
|
59
59
LL | (|| m!())()
60
60
| ^^^^^^^^^^^ help: try doing something like: `m!()`
@@ -65,7 +65,7 @@ LL | m2!();
65
65
= note: this error originates in the macro `m2` (in Nightly builds, run with -Z macro-backtrace for more info)
66
66
67
67
error: try not to call a closure in the expression where it is declared
68
- --> $DIR/redundant_closure_call_fixable.rs:31 :13
68
+ --> $DIR/redundant_closure_call_fixable.rs:32 :13
69
69
|
70
70
LL | (|| 0)()
71
71
| ^^^^^^^^ help: try doing something like: `0`
@@ -76,52 +76,64 @@ LL | m2!();
76
76
= note: this error originates in the macro `m` which comes from the expansion of the macro `m2` (in Nightly builds, run with -Z macro-backtrace for more info)
77
77
78
78
error: try not to call a closure in the expression where it is declared
79
- --> $DIR/redundant_closure_call_fixable.rs:44 :16
79
+ --> $DIR/redundant_closure_call_fixable.rs:45 :16
80
80
|
81
81
LL | assert_eq!((|| || 43)()(), 42);
82
82
| ^^^^^^^^^^^^^^ help: try doing something like: `43`
83
83
84
84
error: try not to call a closure in the expression where it is declared
85
- --> $DIR/redundant_closure_call_fixable.rs:53 :10
85
+ --> $DIR/redundant_closure_call_fixable.rs:54 :10
86
86
|
87
87
LL | dbg!((|| 42)());
88
88
| ^^^^^^^^^ help: try doing something like: `42`
89
89
90
90
error: try not to call a closure in the expression where it is declared
91
- --> $DIR/redundant_closure_call_fixable.rs:56 :13
91
+ --> $DIR/redundant_closure_call_fixable.rs:57 :13
92
92
|
93
93
LL | let a = (|| || || 123)();
94
94
| ^^^^^^^^^^^^^^^^ help: try doing something like: `(|| || 123)`
95
95
96
96
error: try not to call a closure in the expression where it is declared
97
- --> $DIR/redundant_closure_call_fixable.rs:60 :13
97
+ --> $DIR/redundant_closure_call_fixable.rs:61 :13
98
98
|
99
99
LL | let a = (|| || || || async || 1)()()()()();
100
100
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try doing something like: `async { 1 }`
101
101
102
102
error: try not to call a closure in the expression where it is declared
103
- --> $DIR/redundant_closure_call_fixable.rs:69 :13
103
+ --> $DIR/redundant_closure_call_fixable.rs:70 :13
104
104
|
105
105
LL | let a = (|| echo!(|| echo!(|| 1)))()()();
106
106
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try doing something like: `1`
107
107
108
108
error: try not to call a closure in the expression where it is declared
109
- --> $DIR/redundant_closure_call_fixable.rs:71 :13
109
+ --> $DIR/redundant_closure_call_fixable.rs:72 :13
110
110
|
111
111
LL | let a = (|| echo!((|| 123)))()();
112
112
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try doing something like: `123`
113
113
114
114
error: try not to call a closure in the expression where it is declared
115
- --> $DIR/redundant_closure_call_fixable.rs:84 :11
115
+ --> $DIR/redundant_closure_call_fixable.rs:85 :11
116
116
|
117
117
LL | bar()((|| || 42)()(), 5);
118
118
| ^^^^^^^^^^^^^^ help: try doing something like: `42`
119
119
120
120
error: try not to call a closure in the expression where it is declared
121
- --> $DIR/redundant_closure_call_fixable.rs:85 :9
121
+ --> $DIR/redundant_closure_call_fixable.rs:86 :9
122
122
|
123
123
LL | foo((|| || 42)()(), 5);
124
124
| ^^^^^^^^^^^^^^ help: try doing something like: `42`
125
125
126
- error: aborting due to 14 previous errors
126
+ error: try not to call a closure in the expression where it is declared
127
+ --> $DIR/redundant_closure_call_fixable.rs:90:5
128
+ |
129
+ LL | (|| async {})().await;
130
+ | ^^^^^^^^^^^^^^^ help: try doing something like: `(async {})`
131
+
132
+ error: try not to call a closure in the expression where it is declared
133
+ --> $DIR/redundant_closure_call_fixable.rs:99:18
134
+ |
135
+ LL | spawn_on(((|| async move {})()));
136
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: try doing something like: `(async move {})`
137
+
138
+ error: aborting due to 16 previous errors
127
139
0 commit comments