]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-61076.stderr
Rollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68
[rust.git] / tests / 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:91:9
60    |
61 LL |     match tuple() {
62    |           ------- this expression has type `impl Future<Output = Tuple>`
63 LL |
64 LL |         Tuple(_) => {}
65    |         ^^^^^^^^ expected opaque type, found struct `Tuple`
66    |
67 note: while checking the return type of the `async fn`
68   --> $DIR/issue-61076.rs:56:21
69    |
70 LL | async fn tuple() -> Tuple {
71    |                     ^^^^^ checked the `Output` of this `async fn`, expected opaque type
72    = note: expected opaque type `impl Future<Output = Tuple>`
73                    found struct `Tuple`
74 help: consider `await`ing on the `Future`
75    |
76 LL |     match tuple().await {
77    |                  ++++++
78
79 error: aborting due to 6 previous errors
80
81 Some errors have detailed explanations: E0277, E0308, E0599, E0609.
82 For more information about an error, try `rustc --explain E0277`.