]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-74282.stderr
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / ui / impl-trait / issues / issue-74282.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-74282.rs:8:15
3    |
4 LL |   type Closure = impl Fn() -> u64;
5    |                  ---------------- the expected opaque type
6 ...
7 LL |       Anonymous(|| {
8    |  _____---------_^
9    | |     |
10    | |     arguments to this struct are incorrect
11 LL | |         3
12 LL | |     })
13    | |_____^ expected closure, found a different closure
14    |
15    = note: expected opaque type `Closure`
16                   found closure `[closure@$DIR/issue-74282.rs:8:15: 8:17]`
17    = note: no two closures, even if identical, have the same type
18    = help: consider boxing your closure and/or using it as a trait object
19 note: tuple struct defined here
20   --> $DIR/issue-74282.rs:4:8
21    |
22 LL | struct Anonymous(Closure);
23    |        ^^^^^^^^^
24
25 error[E0308]: mismatched types
26   --> $DIR/issue-74282.rs:8:5
27    |
28 LL |   fn main() {
29    |             - expected `()` because of default return type
30 LL |       let y = || -> Closure { || 3 };
31 LL | /     Anonymous(|| {
32 LL | |         3
33 LL | |     })
34    | |      ^- help: consider using a semicolon here: `;`
35    | |______|
36    |        expected `()`, found struct `Anonymous`
37
38 error: aborting due to 2 previous errors
39
40 For more information about this error, try `rustc --explain E0308`.