]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-63279.stderr
Rollup merge of #106732 - durin42:dmitrig-arrayref-ctor, r=nikic
[rust.git] / tests / ui / type-alias-impl-trait / issue-63279.stderr
1 error[E0277]: expected a `FnOnce<()>` closure, found `()`
2   --> $DIR/issue-63279.rs:7:11
3    |
4 LL | fn c() -> Closure {
5    |           ^^^^^^^ expected an `FnOnce<()>` closure, found `()`
6    |
7    = help: the trait `FnOnce<()>` is not implemented for `()`
8    = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
9
10 error[E0277]: expected a `FnOnce<()>` closure, found `()`
11   --> $DIR/issue-63279.rs:9:11
12    |
13 LL |     || -> Closure { || () }
14    |           ^^^^^^^ expected an `FnOnce<()>` closure, found `()`
15    |
16    = help: the trait `FnOnce<()>` is not implemented for `()`
17    = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
18
19 error[E0308]: mismatched types
20   --> $DIR/issue-63279.rs:9:21
21    |
22 LL |     || -> Closure { || () }
23    |                     ^^^^^ expected `()`, found closure
24    |
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
28    |
29 LL |     || -> Closure { (|| ())() }
30    |                     +     +++
31
32 error[E0308]: mismatched types
33   --> $DIR/issue-63279.rs:9:5
34    |
35 LL |     || -> Closure { || () }
36    |     ^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found closure
37    |
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
41    |
42 LL |     (|| -> Closure { || () })()
43    |     +                       +++
44
45 error: aborting due to 4 previous errors
46
47 Some errors have detailed explanations: E0277, E0308.
48 For more information about an error, try `rustc --explain E0277`.