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