mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
35 lines
1.0 KiB
Plaintext
35 lines
1.0 KiB
Plaintext
error: Closure called just once immediately after it was declared
|
|
--> $DIR/redundant_closure_call.rs:12:5
|
|
|
|
|
LL | 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:15:5
|
|
|
|
|
LL | i = closure(3);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: Try not to call a closure in the expression where it is declared.
|
|
--> $DIR/redundant_closure_call.rs:4:13
|
|
|
|
|
LL | 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:7:17
|
|
|
|
|
LL | 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:9:9
|
|
|
|
|
LL | k = (|a, b| a * b)(1, 5);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 5 previous errors
|
|
|