]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/generator-desc.stderr
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / async-await / generator-desc.stderr
1 error[E0308]: mismatched types
2   --> $DIR/generator-desc.rs:10:25
3    |
4 LL |     fun(async {}, async {});
5    |               --        ^^
6    |               |         |
7    |               |         expected `async` block, found a different `async` block
8    |               |         arguments to this function are incorrect
9    |               the expected `async` block
10    |
11    = note: expected `async` block `[static generator@$DIR/generator-desc.rs:10:15: 10:17]`
12               found `async` block `[static generator@$DIR/generator-desc.rs:10:25: 10:27]`
13 note: function defined here
14   --> $SRC_DIR/core/src/future/mod.rs:LL:COL
15    |
16 LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
17    |              ^^^^^^^^^^^^^^
18
19 error[E0308]: mismatched types
20   --> $DIR/generator-desc.rs:12:16
21    |
22 LL |     fun(one(), two());
23    |     ---        ^^^^^ expected opaque type, found a different opaque type
24    |     |
25    |     arguments to this function are incorrect
26    |
27 note: while checking the return type of the `async fn`
28   --> $DIR/generator-desc.rs:5:16
29    |
30 LL | async fn one() {}
31    |                ^ checked the `Output` of this `async fn`, expected opaque type
32 note: while checking the return type of the `async fn`
33   --> $DIR/generator-desc.rs:6:16
34    |
35 LL | async fn two() {}
36    |                ^ checked the `Output` of this `async fn`, found opaque type
37    = note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:5:16>)
38               found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:6:16>)
39    = help: consider `await`ing on both `Future`s
40    = note: distinct uses of `impl Trait` result in different opaque types
41 note: function defined here
42   --> $DIR/generator-desc.rs:8:4
43    |
44 LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
45    |    ^^^                         -----  -----
46
47 error[E0308]: mismatched types
48   --> $DIR/generator-desc.rs:14:26
49    |
50 LL |     fun((async || {})(), (async || {})());
51    |     ---           --     ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body
52    |     |             |
53    |     |             the expected `async` closure body
54    |     arguments to this function are incorrect
55    |
56   ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
57    |
58 LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
59    |                                           -------------------------------
60    |                                           |
61    |                                           the expected opaque type
62    |                                           the found opaque type
63    |
64    = note: expected opaque type `impl Future<Output = ()>` (`async` closure body)
65               found opaque type `impl Future<Output = ()>` (`async` closure body)
66 note: function defined here
67   --> $DIR/generator-desc.rs:8:4
68    |
69 LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
70    |    ^^^                         -----  -----
71
72 error: aborting due to 3 previous errors
73
74 For more information about this error, try `rustc --explain E0308`.