summary refs log tree commit diff
path: root/src/test/ui/impl-trait/issues/issue-74282.stderr
blob: 6e02a6b2b87b4c71d6abb2010b1ebf2a97a56a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
error[E0308]: mismatched types
  --> $DIR/issue-74282.rs:8:15
   |
LL |   type Closure = impl Fn() -> u64;
   |                  ---------------- the expected opaque type
...
LL |       Anonymous(|| {
   |  _______________^
LL | |         3
LL | |     })
   | |_____^ expected closure, found a different closure
   |
   = note: expected opaque type `Closure`
                  found closure `[closure@$DIR/issue-74282.rs:8:15: 10:6]`
   = note: no two closures, even if identical, have the same type
   = help: consider boxing your closure and/or using it as a trait object

error[E0308]: mismatched types
  --> $DIR/issue-74282.rs:8:5
   |
LL |   fn main() {
   |             - expected `()` because of default return type
LL |       let y = || -> Closure { || 3 };
LL | /     Anonymous(|| {
LL | |         3
LL | |     })
   | |      ^- help: consider using a semicolon here: `;`
   | |______|
   |        expected `()`, found struct `Anonymous`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.