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