2022-08-25 20:25:56 -05:00
|
|
|
error[E0308]: mismatched types
|
2022-08-27 23:11:57 -05:00
|
|
|
--> $DIR/return-closures.rs:3:5
|
2022-08-25 20:25:56 -05:00
|
|
|
|
|
|
|
|
LL | fn foo() {
|
2024-04-10 17:42:48 -05:00
|
|
|
| - help: try adding a return type: `-> impl FnOnce(&i32) -> i32`
|
2022-08-27 23:11:57 -05:00
|
|
|
LL |
|
2022-08-25 20:25:56 -05:00
|
|
|
LL | |x: &i32| 1i32
|
|
|
|
| ^^^^^^^^^^^^^^ expected `()`, found closure
|
|
|
|
|
|
|
|
|
= note: expected unit type `()`
|
2023-09-09 01:36:50 -05:00
|
|
|
found closure `{closure@$DIR/return-closures.rs:3:5: 3:14}`
|
2022-08-25 20:25:56 -05:00
|
|
|
|
2022-08-27 23:11:57 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/return-closures.rs:9:5
|
|
|
|
|
|
|
|
|
LL | fn bar(i: impl Sized) {
|
2023-09-30 14:29:41 -05:00
|
|
|
| - help: a return type might be missing here: `-> _`
|
2022-08-27 23:11:57 -05:00
|
|
|
LL |
|
|
|
|
LL | || i
|
|
|
|
| ^^^^ expected `()`, found closure
|
|
|
|
|
|
|
|
|
= note: expected unit type `()`
|
2023-09-09 01:36:50 -05:00
|
|
|
found closure `{closure@$DIR/return-closures.rs:9:5: 9:7}`
|
2022-08-27 23:11:57 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2022-08-25 20:25:56 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|