rust/tests/ui/suggestions/return-closures.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
836 B
Plaintext
Raw Normal View History

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() {
2022-09-21 10:57:30 -05:00
| - help: try adding a return type: `-> impl for<'a> Fn(&'a 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 `()`
2022-08-27 23:11:57 -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) {
| - help: a return type might be missing here: `-> _`
LL |
LL | || i
| ^^^^ expected `()`, found closure
|
= note: expected unit type `()`
found closure `[closure@$DIR/return-closures.rs:9:5: 9:7]`
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`.