rust-clippy/tests/ui/redundant_closure_call.stderr

35 lines
1 KiB
Text
Raw Normal View History

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