fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
976 B26 linesraw
1error[E0277]: the `?` operator can only be applied to values that implement `Try`
2  --> $DIR/issue-84841.rs:9:5
3   |
4LL |     test()?;
5   |     ^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = ()>`
6   |
7   = help: the trait `Try` is not implemented for `impl Future<Output = ()>`
8
9error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
10  --> $DIR/issue-84841.rs:9:11
11   |
12LL |   async fn foo() {
13   |  ________________-
14LL | |     // Adding an .await here avoids the ICE
15LL | |     test()?;
16   | |           ^ cannot use the `?` operator in an async function that returns `()`
17LL | |
18LL | |
19LL | | }
20   | |_- this function should return `Result` or `Option` to accept `?`
21   |
22   = help: the trait `FromResidual<_>` is not implemented for `()`
23
24error: aborting due to 2 previous errors
25
26For more information about this error, try `rustc --explain E0277`.