@@ -91,75 +91,83 @@ LL | let _ = bar().await()?;
91
91
error[E0728]: `await` is only allowed inside `async` functions and blocks
92
92
--> $DIR/incorrect-syntax-suggestions.rs:55:13
93
93
|
94
- LL | async fn foo8() -> Result<(), ()> {
95
- | --------------------------------- this function is not `async`
96
- ...
94
+ LL | fn foo9() -> Result<(), ()> {
95
+ | ---- this is not `async`
97
96
LL | let _ = await bar();
98
97
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
99
98
100
99
error[E0728]: `await` is only allowed inside `async` functions and blocks
101
100
--> $DIR/incorrect-syntax-suggestions.rs:60:13
102
101
|
103
- LL | fn foo9() -> Result<(), ()> {
104
- | --------------------------- this function is not `async`
105
- ...
102
+ LL | fn foo10() -> Result<(), ()> {
103
+ | ----- this is not `async`
106
104
LL | let _ = await? bar();
107
105
| ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
108
106
109
107
error[E0728]: `await` is only allowed inside `async` functions and blocks
110
108
--> $DIR/incorrect-syntax-suggestions.rs:65:13
111
109
|
112
- LL | fn foo10() -> Result<(), ()> {
113
- | ---------------------------- this function is not `async`
114
- ...
110
+ LL | fn foo11() -> Result<(), ()> {
111
+ | ----- this is not `async`
115
112
LL | let _ = await bar()?;
116
113
| ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
117
114
118
115
error[E0728]: `await` is only allowed inside `async` functions and blocks
119
116
--> $DIR/incorrect-syntax-suggestions.rs:70:14
120
117
|
121
- LL | fn foo11() -> Result<(), ()> {
122
- | ---------------------------- this function is not `async`
123
- ...
118
+ LL | fn foo12() -> Result<(), ()> {
119
+ | ----- this is not `async`
124
120
LL | let _ = (await bar())?;
125
121
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
126
122
127
123
error[E0728]: `await` is only allowed inside `async` functions and blocks
128
124
--> $DIR/incorrect-syntax-suggestions.rs:75:13
129
125
|
130
- LL | fn foo12() -> Result<(), ()> {
131
- | ---------------------------- this function is not `async`
132
- ...
126
+ LL | fn foo13() -> Result<(), ()> {
127
+ | ----- this is not `async`
133
128
LL | let _ = bar().await();
134
129
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
135
130
136
131
error[E0728]: `await` is only allowed inside `async` functions and blocks
137
132
--> $DIR/incorrect-syntax-suggestions.rs:80:13
138
133
|
139
- LL | fn foo13() -> Result<(), ()> {
140
- | ---------------------------- this function is not `async`
141
- ...
134
+ LL | fn foo14() -> Result<(), ()> {
135
+ | ----- this is not `async`
142
136
LL | let _ = bar().await()?;
143
137
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
144
138
145
139
error[E0728]: `await` is only allowed inside `async` functions and blocks
146
140
--> $DIR/incorrect-syntax-suggestions.rs:85:13
147
141
|
148
- LL | fn foo14() -> Result<(), ()> {
149
- | ---------------------------- this function is not `async`
150
- ...
142
+ LL | fn foo15() -> Result<(), ()> {
143
+ | ----- this is not `async`
151
144
LL | let _ = bar().await;
152
145
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
153
146
154
147
error[E0728]: `await` is only allowed inside `async` functions and blocks
155
148
--> $DIR/incorrect-syntax-suggestions.rs:89:13
156
149
|
157
- LL | fn foo15() -> Result<(), ()> {
158
- | ---------------------------- this function is not `async`
159
- ...
150
+ LL | fn foo16() -> Result<(), ()> {
151
+ | ----- this is not `async`
160
152
LL | let _ = bar().await?;
161
153
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
162
154
155
+ error[E0728]: `await` is only allowed inside `async` functions and blocks
156
+ --> $DIR/incorrect-syntax-suggestions.rs:94:17
157
+ |
158
+ LL | fn foo() -> Result<(), ()> {
159
+ | --- this is not `async`
160
+ LL | let _ = bar().await?;
161
+ | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
162
+
163
+ error[E0728]: `await` is only allowed inside `async` functions and blocks
164
+ --> $DIR/incorrect-syntax-suggestions.rs:101:17
165
+ |
166
+ LL | let foo = || {
167
+ | -- this is not `async`
168
+ LL | let _ = bar().await?;
169
+ | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
170
+
163
171
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
164
172
--> $DIR/incorrect-syntax-suggestions.rs:18:19
165
173
|
@@ -169,6 +177,6 @@ LL | let _ = await bar()?;
169
177
= help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
170
178
= note: required by `std::ops::Try::into_result`
171
179
172
- error: aborting due to 24 previous errors
180
+ error: aborting due to 26 previous errors
173
181
174
182
For more information about this error, try `rustc --explain E0277`.
0 commit comments