1 error: incorrect use of `await`
2 --> $DIR/incorrect-syntax-suggestions.rs:10:13
4 LL | let _ = await bar();
5 | ^^^^^^^^^^^ help: `await` is not a statement: `bar().await`
7 error: incorrect use of `await`
8 --> $DIR/incorrect-syntax-suggestions.rs:14:13
10 LL | let _ = await? bar();
11 | ^^^^^^^^^^^^ help: `await` is not a statement: `bar().await?`
13 error: incorrect use of `await`
14 --> $DIR/incorrect-syntax-suggestions.rs:18:13
16 LL | let _ = await bar()?;
17 | ^^^^^^^^^^^^ help: `await` is not a statement: `bar()?.await`
19 error: incorrect use of `await`
20 --> $DIR/incorrect-syntax-suggestions.rs:23:13
22 LL | let _ = await { bar() };
23 | ^^^^^^^^^^^^^^^ help: `await` is not a statement: `{ bar() }.await`
25 error: incorrect use of `await`
26 --> $DIR/incorrect-syntax-suggestions.rs:27:13
28 LL | let _ = await(bar());
29 | ^^^^^^^^^^^^ help: `await` is not a statement: `(bar()).await`
31 error: incorrect use of `await`
32 --> $DIR/incorrect-syntax-suggestions.rs:31:13
34 LL | let _ = await { bar() }?;
35 | ^^^^^^^^^^^^^^^ help: `await` is not a statement: `{ bar() }.await`
37 error: incorrect use of `await`
38 --> $DIR/incorrect-syntax-suggestions.rs:35:14
40 LL | let _ = (await bar())?;
41 | ^^^^^^^^^^^ help: `await` is not a statement: `bar().await`
43 error: incorrect use of `await`
44 --> $DIR/incorrect-syntax-suggestions.rs:39:24
46 LL | let _ = bar().await();
47 | ^^ help: `await` is not a method call, remove the parentheses
49 error: incorrect use of `await`
50 --> $DIR/incorrect-syntax-suggestions.rs:43:24
52 LL | let _ = bar().await()?;
53 | ^^ help: `await` is not a method call, remove the parentheses
55 error: incorrect use of `await`
56 --> $DIR/incorrect-syntax-suggestions.rs:55:13
58 LL | let _ = await bar();
59 | ^^^^^^^^^^^ help: `await` is not a statement: `bar().await`
61 error: incorrect use of `await`
62 --> $DIR/incorrect-syntax-suggestions.rs:60:13
64 LL | let _ = await? bar();
65 | ^^^^^^^^^^^^ help: `await` is not a statement: `bar().await?`
67 error: incorrect use of `await`
68 --> $DIR/incorrect-syntax-suggestions.rs:65:13
70 LL | let _ = await bar()?;
71 | ^^^^^^^^^^^^ help: `await` is not a statement: `bar()?.await`
73 error: incorrect use of `await`
74 --> $DIR/incorrect-syntax-suggestions.rs:70:14
76 LL | let _ = (await bar())?;
77 | ^^^^^^^^^^^ help: `await` is not a statement: `bar().await`
79 error: incorrect use of `await`
80 --> $DIR/incorrect-syntax-suggestions.rs:75:24
82 LL | let _ = bar().await();
83 | ^^ help: `await` is not a method call, remove the parentheses
85 error: incorrect use of `await`
86 --> $DIR/incorrect-syntax-suggestions.rs:80:24
88 LL | let _ = bar().await()?;
89 | ^^ help: `await` is not a method call, remove the parentheses
91 error: expected expression, found `=>`
92 --> $DIR/incorrect-syntax-suggestions.rs:108:25
94 LL | match await { await => () }
95 | ----- ^^ expected expression
97 | while parsing this incorrect await statement
99 error: incorrect use of `await`
100 --> $DIR/incorrect-syntax-suggestions.rs:108:11
102 LL | match await { await => () }
103 | ^^^^^^^^^^^^^^^^^^^^^ help: `await` is not a statement: `{ await => () }.await`
105 error: expected one of `.`, `?`, `{`, or an operator, found `}`
106 --> $DIR/incorrect-syntax-suggestions.rs:111:1
108 LL | match await { await => () }
109 | ----- - expected one of `.`, `?`, `{`, or an operator here
111 | while parsing this match expression
116 error[E0728]: `await` is only allowed inside `async` functions and blocks
117 --> $DIR/incorrect-syntax-suggestions.rs:55:13
119 LL | fn foo9() -> Result<(), ()> {
120 | ---- this is not `async`
121 LL | let _ = await bar();
122 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
124 error[E0728]: `await` is only allowed inside `async` functions and blocks
125 --> $DIR/incorrect-syntax-suggestions.rs:60:13
127 LL | fn foo10() -> Result<(), ()> {
128 | ----- this is not `async`
129 LL | let _ = await? bar();
130 | ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
132 error[E0728]: `await` is only allowed inside `async` functions and blocks
133 --> $DIR/incorrect-syntax-suggestions.rs:65:13
135 LL | fn foo11() -> Result<(), ()> {
136 | ----- this is not `async`
137 LL | let _ = await bar()?;
138 | ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
140 error[E0728]: `await` is only allowed inside `async` functions and blocks
141 --> $DIR/incorrect-syntax-suggestions.rs:70:14
143 LL | fn foo12() -> Result<(), ()> {
144 | ----- this is not `async`
145 LL | let _ = (await bar())?;
146 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
148 error[E0728]: `await` is only allowed inside `async` functions and blocks
149 --> $DIR/incorrect-syntax-suggestions.rs:75:13
151 LL | fn foo13() -> Result<(), ()> {
152 | ----- this is not `async`
153 LL | let _ = bar().await();
154 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
156 error[E0728]: `await` is only allowed inside `async` functions and blocks
157 --> $DIR/incorrect-syntax-suggestions.rs:80:13
159 LL | fn foo14() -> Result<(), ()> {
160 | ----- this is not `async`
161 LL | let _ = bar().await()?;
162 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
164 error[E0728]: `await` is only allowed inside `async` functions and blocks
165 --> $DIR/incorrect-syntax-suggestions.rs:85:13
167 LL | fn foo15() -> Result<(), ()> {
168 | ----- this is not `async`
169 LL | let _ = bar().await;
170 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
172 error[E0728]: `await` is only allowed inside `async` functions and blocks
173 --> $DIR/incorrect-syntax-suggestions.rs:89:13
175 LL | fn foo16() -> Result<(), ()> {
176 | ----- this is not `async`
177 LL | let _ = bar().await?;
178 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
180 error[E0728]: `await` is only allowed inside `async` functions and blocks
181 --> $DIR/incorrect-syntax-suggestions.rs:94:17
183 LL | fn foo() -> Result<(), ()> {
184 | --- this is not `async`
185 LL | let _ = bar().await?;
186 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
188 error[E0728]: `await` is only allowed inside `async` functions and blocks
189 --> $DIR/incorrect-syntax-suggestions.rs:101:17
192 | -- this is not `async`
193 LL | let _ = bar().await?;
194 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
196 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
197 --> $DIR/incorrect-syntax-suggestions.rs:18:19
199 LL | let _ = await bar()?;
200 | ^^^^^^ the `?` operator cannot be applied to type `impl std::future::Future`
202 = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
203 = note: required by `std::ops::Try::into_result`
205 error: aborting due to 29 previous errors
207 For more information about this error, try `rustc --explain E0277`.