]>
Commit | Line | Data |
---|---|---|
5e7ed085 FG |
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(|| { | |
923072b8 FG |
8 | | _____---------_^ |
9 | | | | | |
10 | | | arguments to this struct are incorrect | |
5e7ed085 FG |
11 | LL | | 3 |
12 | LL | | }) | |
13 | | |_____^ expected closure, found a different closure | |
14 | | | |
15 | = note: expected opaque type `Closure` | |
064997fb | 16 | found closure `[closure@$DIR/issue-74282.rs:8:15: 8:17]` |
5e7ed085 FG |
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 | |
923072b8 FG |
19 | note: tuple struct defined here |
20 | --> $DIR/issue-74282.rs:4:8 | |
21 | | | |
22 | LL | struct Anonymous(Closure); | |
23 | | ^^^^^^^^^ | |
5e7ed085 FG |
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`. |