42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
|
error: Closure called just once immediately after it was declared
|
||
|
--> $DIR/redundant_closure_call.rs:18:2
|
||
|
|
|
||
|
18 | \ti = closure(); //~ERROR Closure called just once immediately after it was declared
|
||
|
| \t^^^^^^^^^^^^^
|
||
|
|
|
||
|
note: lint level defined here
|
||
|
--> $DIR/redundant_closure_call.rs:4:9
|
||
|
|
|
||
|
4 | #![deny(redundant_closure_call)]
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||
|
|
||
|
error: Closure called just once immediately after it was declared
|
||
|
--> $DIR/redundant_closure_call.rs:21:2
|
||
|
|
|
||
|
21 | \ti = closure(3); //~ERROR Closure called just once immediately after it was declared
|
||
|
| \t^^^^^^^^^^^^^^
|
||
|
|
||
|
error: Try not to call a closure in the expression where it is declared.
|
||
|
--> $DIR/redundant_closure_call.rs:7:10
|
||
|
|
|
||
|
7 | \tlet a = (|| 42)();
|
||
|
| \t ^^^^^^^^^
|
||
|
|
|
||
|
help: Try doing something like:
|
||
|
| \tlet a = 42;
|
||
|
|
||
|
error: Try not to call a closure in the expression where it is declared.
|
||
|
--> $DIR/redundant_closure_call.rs:13:10
|
||
|
|
|
||
|
13 | \tlet k = (|m| m+1)(i); //~ERROR Try not to call a closure in the expression where it is declared.
|
||
|
| \t ^^^^^^^^^^^^
|
||
|
|
||
|
error: Try not to call a closure in the expression where it is declared.
|
||
|
--> $DIR/redundant_closure_call.rs:15:6
|
||
|
|
|
||
|
15 | \tk = (|a,b| a*b)(1,5); //~ERROR Try not to call a closure in the expression where it is declared.
|
||
|
| \t ^^^^^^^^^^^^^^^^
|
||
|
|
||
|
error: aborting due to 5 previous errors
|
||
|
|