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-26 01:25:56 +00:00
error[E0308]: mismatched types
2022-08-28 04:11:57 +00:00
--> $DIR/return-closures.rs:3:5
2022-08-26 01:25:56 +00:00
|
LL | fn foo() {
2022-09-21 17:57:30 +02:00
| - help: try adding a return type: `-> impl for<'a> Fn(&'a i32) -> i32`
2022-08-28 04:11:57 +00:00
LL |
2022-08-26 01:25:56 +00:00
LL | |x: &i32| 1i32
| ^^^^^^^^^^^^^^ expected `()`, found closure
|
= note: expected unit type `()`
2022-08-28 04:11:57 +00:00
found closure `[closure@$DIR/return-closures.rs:3:5: 3:14]`
2022-08-26 01:25:56 +00:00
2022-08-28 04:11:57 +00: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-26 01:25:56 +00:00
For more information about this error, try `rustc --explain E0308`.