@@ -91,75 +91,83 @@ LL | let _ = bar().await()?;
9191error[E0728]: `await` is only allowed inside `async` functions and blocks
9292 --> $DIR/incorrect-syntax-suggestions.rs:55:13
9393 |
94- LL | async fn foo8() -> Result<(), ()> {
95- | --------------------------------- this function is not `async`
96- ...
94+ LL | fn foo9() -> Result<(), ()> {
95+ | ---- this is not `async`
9796LL | let _ = await bar();
9897 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
9998
10099error[E0728]: `await` is only allowed inside `async` functions and blocks
101100 --> $DIR/incorrect-syntax-suggestions.rs:60:13
102101 |
103- LL | fn foo9() -> Result<(), ()> {
104- | --------------------------- this function is not `async`
105- ...
102+ LL | fn foo10() -> Result<(), ()> {
103+ | ----- this is not `async`
106104LL | let _ = await? bar();
107105 | ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
108106
109107error[E0728]: `await` is only allowed inside `async` functions and blocks
110108 --> $DIR/incorrect-syntax-suggestions.rs:65:13
111109 |
112- LL | fn foo10() -> Result<(), ()> {
113- | ---------------------------- this function is not `async`
114- ...
110+ LL | fn foo11() -> Result<(), ()> {
111+ | ----- this is not `async`
115112LL | let _ = await bar()?;
116113 | ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
117114
118115error[E0728]: `await` is only allowed inside `async` functions and blocks
119116 --> $DIR/incorrect-syntax-suggestions.rs:70:14
120117 |
121- LL | fn foo11() -> Result<(), ()> {
122- | ---------------------------- this function is not `async`
123- ...
118+ LL | fn foo12() -> Result<(), ()> {
119+ | ----- this is not `async`
124120LL | let _ = (await bar())?;
125121 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
126122
127123error[E0728]: `await` is only allowed inside `async` functions and blocks
128124 --> $DIR/incorrect-syntax-suggestions.rs:75:13
129125 |
130- LL | fn foo12() -> Result<(), ()> {
131- | ---------------------------- this function is not `async`
132- ...
126+ LL | fn foo13() -> Result<(), ()> {
127+ | ----- this is not `async`
133128LL | let _ = bar().await();
134129 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
135130
136131error[E0728]: `await` is only allowed inside `async` functions and blocks
137132 --> $DIR/incorrect-syntax-suggestions.rs:80:13
138133 |
139- LL | fn foo13() -> Result<(), ()> {
140- | ---------------------------- this function is not `async`
141- ...
134+ LL | fn foo14() -> Result<(), ()> {
135+ | ----- this is not `async`
142136LL | let _ = bar().await()?;
143137 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
144138
145139error[E0728]: `await` is only allowed inside `async` functions and blocks
146140 --> $DIR/incorrect-syntax-suggestions.rs:85:13
147141 |
148- LL | fn foo14() -> Result<(), ()> {
149- | ---------------------------- this function is not `async`
150- ...
142+ LL | fn foo15() -> Result<(), ()> {
143+ | ----- this is not `async`
151144LL | let _ = bar().await;
152145 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
153146
154147error[E0728]: `await` is only allowed inside `async` functions and blocks
155148 --> $DIR/incorrect-syntax-suggestions.rs:89:13
156149 |
157- LL | fn foo15() -> Result<(), ()> {
158- | ---------------------------- this function is not `async`
159- ...
150+ LL | fn foo16() -> Result<(), ()> {
151+ | ----- this is not `async`
160152LL | let _ = bar().await?;
161153 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
162154
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+
163171error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
164172 --> $DIR/incorrect-syntax-suggestions.rs:18:19
165173 |
@@ -169,6 +177,6 @@ LL | let _ = await bar()?;
169177 = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
170178 = note: required by `std::ops::Try::into_result`
171179
172- error: aborting due to 24 previous errors
180+ error: aborting due to 26 previous errors
173181
174182For more information about this error, try `rustc --explain E0277`.
0 commit comments