]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-61076.stderr
remove [async output] from impl Future
[rust.git] / src / test / ui / async-await / issue-61076.stderr
1 error[E0277]: the `?` operator can only be applied to values that implement `Try`
2   --> $DIR/issue-61076.rs:42:5
3    |
4 LL |     foo()?;
5    |     ^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>`
6    |
7    = help: the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>`
8 help: consider `await`ing on the `Future`
9    |
10 LL |     foo().await?;
11    |          ++++++
12
13 error[E0277]: the `?` operator can only be applied to values that implement `Try`
14   --> $DIR/issue-61076.rs:65:5
15    |
16 LL |     t?;
17    |     ^^ the `?` operator cannot be applied to type `T`
18    |
19    = help: the trait `Try` is not implemented for `T`
20 help: consider `await`ing on the `Future`
21    |
22 LL |     t.await?;
23    |      ++++++
24
25 error[E0609]: no field `0` on type `impl Future<Output = Tuple>`
26   --> $DIR/issue-61076.rs:74:26
27    |
28 LL |     let _: i32 = tuple().0;
29    |                          ^ field not available in `impl Future`, but it is available in its `Output`
30    |
31 help: consider `await`ing on the `Future` and access the field of its `Output`
32    |
33 LL |     let _: i32 = tuple().await.0;
34    |                         ++++++
35
36 error[E0609]: no field `a` on type `impl Future<Output = Struct>`
37   --> $DIR/issue-61076.rs:78:28
38    |
39 LL |     let _: i32 = struct_().a;
40    |                            ^ field not available in `impl Future`, but it is available in its `Output`
41    |
42 help: consider `await`ing on the `Future` and access the field of its `Output`
43    |
44 LL |     let _: i32 = struct_().await.a;
45    |                           ++++++
46
47 error[E0599]: no method named `method` found for opaque type `impl Future<Output = Struct>` in the current scope
48   --> $DIR/issue-61076.rs:82:15
49    |
50 LL |     struct_().method();
51    |               ^^^^^^ method not found in `impl Future<Output = Struct>`
52    |
53 help: consider `await`ing on the `Future` and calling the method on its `Output`
54    |
55 LL |     struct_().await.method();
56    |               ++++++
57
58 error[E0308]: mismatched types
59   --> $DIR/issue-61076.rs:90:9
60    |
61 LL |         Tuple(_) => {}
62    |         ^^^^^^^^ expected opaque type, found struct `Tuple`
63    |
64 note: while checking the return type of the `async fn`
65   --> $DIR/issue-61076.rs:56:21
66    |
67 LL | async fn tuple() -> Tuple {
68    |                     ^^^^^ checked the `Output` of this `async fn`, expected opaque type
69    = note: expected opaque type `impl Future<Output = Tuple>`
70                    found struct `Tuple`
71 help: consider `await`ing on the `Future`
72    |
73 LL |     match tuple().await {
74    |                  ++++++
75
76 error: aborting due to 6 previous errors
77
78 Some errors have detailed explanations: E0277, E0308, E0599, E0609.
79 For more information about an error, try `rustc --explain E0277`.