2017-08-01 10:54:21 -05:00
|
|
|
error: Closure called just once immediately after it was declared
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/redundant_closure_call.rs:25:2
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
25 | i = closure();
|
2017-12-07 04:20:48 -06:00
|
|
|
| ^^^^^^^^^^^^^
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::redundant-closure-call` implied by `-D warnings`
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
|
|
error: Closure called just once immediately after it was declared
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/redundant_closure_call.rs:28:2
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
28 | i = closure(3);
|
2017-12-07 04:20:48 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
|
|
error: Try not to call a closure in the expression where it is declared.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/redundant_closure_call.rs:17:10
|
|
|
|
|
|
|
|
|
17 | let a = (|| 42)();
|
|
|
|
| ^^^^^^^^^ help: Try doing something like: : `42`
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
|
|
error: Try not to call a closure in the expression where it is declared.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/redundant_closure_call.rs:20:14
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
20 | let mut k = (|m| m+1)(i);
|
2017-12-07 04:20:48 -06:00
|
|
|
| ^^^^^^^^^^^^
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
|
|
error: Try not to call a closure in the expression where it is declared.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/redundant_closure_call.rs:22:6
|
2017-08-01 10:54:21 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
22 | k = (|a,b| a*b)(1,5);
|
2017-12-07 04:20:48 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^
|
2017-08-01 10:54:21 -05:00
|
|
|
|
2018-01-16 10:06:27 -06:00
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
|