]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/return-closures.stderr
Rollup merge of #107264 - ferrocene:pa-private-items, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / return-closures.stderr
1 error[E0308]: mismatched types
2   --> $DIR/return-closures.rs:3:5
3    |
4 LL | fn foo() {
5    |          - help: try adding a return type: `-> impl for<'a> Fn(&'a i32) -> i32`
6 LL |
7 LL |     |x: &i32| 1i32
8    |     ^^^^^^^^^^^^^^ expected `()`, found closure
9    |
10    = note: expected unit type `()`
11                 found closure `[closure@$DIR/return-closures.rs:3:5: 3:14]`
12
13 error[E0308]: mismatched types
14   --> $DIR/return-closures.rs:9:5
15    |
16 LL | fn bar(i: impl Sized) {
17    |                       - help: a return type might be missing here: `-> _`
18 LL |
19 LL |     || i
20    |     ^^^^ expected `()`, found closure
21    |
22    = note: expected unit type `()`
23                 found closure `[closure@$DIR/return-closures.rs:9:5: 9:7]`
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0308`.