You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/test/ui/async-await/try-on-option-in-async.stderr
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,47 @@
1
-
error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `Try`)
2
-
--> $DIR/try-on-option-in-async.rs:8:9
1
+
error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`)
2
+
--> $DIR/try-on-option-in-async.rs:8:10
3
3
|
4
4
LL | async {
5
5
| ___________-
6
6
LL | | let x: Option<u32> = None;
7
7
LL | | x?;
8
-
| | ^^ cannot use the `?` operator in an async block that returns `{integer}`
8
+
| | ^ cannot use the `?` operator in an async block that returns `{integer}`
9
9
LL | | 22
10
10
LL | | }
11
11
| |_____- this function should return `Result` or `Option` to accept `?`
12
12
|
13
-
= help: the trait `Try` is not implemented for `{integer}`
14
-
= note: required by `from_error`
13
+
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}`
14
+
= note: required by `from_residual`
15
15
16
-
error[E0277]: the `?` operator can only be used in an async closure that returns `Result` or `Option` (or another type that implements `Try`)
17
-
--> $DIR/try-on-option-in-async.rs:17:9
16
+
error[E0277]: the `?` operator can only be used in an async closure that returns `Result` or `Option` (or another type that implements `FromResidual`)
17
+
--> $DIR/try-on-option-in-async.rs:17:10
18
18
|
19
19
LL | let async_closure = async || {
20
20
| __________________________________-
21
21
LL | | let x: Option<u32> = None;
22
22
LL | | x?;
23
-
| | ^^ cannot use the `?` operator in an async closure that returns `u32`
23
+
| | ^ cannot use the `?` operator in an async closure that returns `u32`
24
24
LL | | 22_u32
25
25
LL | | };
26
26
| |_____- this function should return `Result` or `Option` to accept `?`
27
27
|
28
-
= help: the trait `Try` is not implemented for `u32`
29
-
= note: required by `from_error`
28
+
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
29
+
= note: required by `from_residual`
30
30
31
-
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `Try`)
32
-
--> $DIR/try-on-option-in-async.rs:26:5
31
+
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
32
+
--> $DIR/try-on-option-in-async.rs:26:6
33
33
|
34
34
LL | async fn an_async_function() -> u32 {
35
35
| _____________________________________-
36
36
LL | | let x: Option<u32> = None;
37
37
LL | | x?;
38
-
| | ^^ cannot use the `?` operator in an async function that returns `u32`
38
+
| | ^ cannot use the `?` operator in an async function that returns `u32`
39
39
LL | | 22
40
40
LL | | }
41
41
| |_- this function should return `Result` or `Option` to accept `?`
42
42
|
43
-
= help: the trait `Try` is not implemented for `u32`
44
-
= note: required by `from_error`
43
+
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
0 commit comments