mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
33 lines
947 B
Plaintext
33 lines
947 B
Plaintext
error: Closure called just once immediately after it was declared
|
|
--> $DIR/redundant_closure_call.rs:15:2
|
|
|
|
|
15 | i = closure();
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
|
|
|
18 | i = closure(3);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: Try not to call a closure in the expression where it is declared.
|
|
--> $DIR/redundant_closure_call.rs:7:10
|
|
|
|
|
7 | 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:10:14
|
|
|
|
|
10 | 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:12:6
|
|
|
|
|
12 | k = (|a,b| a*b)(1,5);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|