rust/tests/ui/redundant_closure_call.stderr

35 lines
1.0 KiB
Plaintext
Raw Normal View History

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