1 error[E0277]: expected a `FnOnce<()>` closure, found `()`
2 --> $DIR/issue-63279.rs:7:11
4 LL | fn c() -> Closure {
5 | ^^^^^^^ expected an `FnOnce<()>` closure, found `()`
7 = help: the trait `FnOnce<()>` is not implemented for `()`
8 = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
10 error[E0277]: expected a `FnOnce<()>` closure, found `()`
11 --> $DIR/issue-63279.rs:9:11
13 LL | || -> Closure { || () }
14 | ^^^^^^^ expected an `FnOnce<()>` closure, found `()`
16 = help: the trait `FnOnce<()>` is not implemented for `()`
17 = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
19 error[E0308]: mismatched types
20 --> $DIR/issue-63279.rs:9:21
22 LL | || -> Closure { || () }
23 | ^^^^^ expected `()`, found closure
25 = note: expected unit type `()`
26 found closure `[closure@$DIR/issue-63279.rs:9:21: 9:23]`
27 help: use parentheses to call this closure
29 LL | || -> Closure { (|| ())() }
32 error[E0308]: mismatched types
33 --> $DIR/issue-63279.rs:9:5
35 LL | || -> Closure { || () }
36 | ^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found closure
38 = note: expected unit type `()`
39 found closure `[closure@$DIR/issue-63279.rs:9:5: 9:18]`
40 help: use parentheses to call this closure
42 LL | (|| -> Closure { || () })()
45 error: aborting due to 4 previous errors
47 Some errors have detailed explanations: E0277, E0308.
48 For more information about an error, try `rustc --explain E0277`.