rust/tests/ui/redundant_closure_call.stderr

35 lines
1.0 KiB
Plaintext

error: Closure called just once immediately after it was declared
--> $DIR/redundant_closure_call.rs:25:2
|
25 | i = closure();
| ^^^^^^^^^^^^^
|
= note: `-D clippy::redundant-closure-call` implied by `-D warnings`
error: Closure called just once immediately after it was declared
--> $DIR/redundant_closure_call.rs:28:2
|
28 | i = closure(3);
| ^^^^^^^^^^^^^^
error: Try not to call a closure in the expression where it is declared.
--> $DIR/redundant_closure_call.rs:17:10
|
17 | let a = (|| 42)();
| ^^^^^^^^^ help: Try doing something like: : `42`
error: Try not to call a closure in the expression where it is declared.
--> $DIR/redundant_closure_call.rs:20:14
|
20 | let mut k = (|m| m+1)(i);
| ^^^^^^^^^^^^
error: Try not to call a closure in the expression where it is declared.
--> $DIR/redundant_closure_call.rs:22:6
|
22 | k = (|a,b| a*b)(1,5);
| ^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors