1 error: incorrect use of `await`
2 --> $DIR/incorrect-syntax-suggestions.rs:10:13
4 LL | let _ = await bar();
7 | help: `await` is not a statement: `bar().await`
9 error: incorrect use of `await`
10 --> $DIR/incorrect-syntax-suggestions.rs:14:13
12 LL | let _ = await? bar();
15 | help: `await` is not a statement: `bar().await?`
17 error: incorrect use of `await`
18 --> $DIR/incorrect-syntax-suggestions.rs:18:13
20 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:23:13
28 LL | let _ = await { bar() };
31 | help: `await` is not a statement: `{ bar() }.await`
33 error: incorrect use of `await`
34 --> $DIR/incorrect-syntax-suggestions.rs:27:13
36 LL | let _ = await(bar());
39 | help: `await` is not a statement: `(bar()).await`
41 error: incorrect use of `await`
42 --> $DIR/incorrect-syntax-suggestions.rs:31:13
44 LL | let _ = await { bar() }?;
47 | help: `await` is not a statement: `{ bar() }.await`
49 error: incorrect use of `await`
50 --> $DIR/incorrect-syntax-suggestions.rs:35:14
52 LL | let _ = (await bar())?;
55 | help: `await` is not a statement: `bar().await`
57 error: incorrect use of `await`
58 --> $DIR/incorrect-syntax-suggestions.rs:39:13
60 LL | let _ = bar().await();
61 | ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
63 error: incorrect use of `await`
64 --> $DIR/incorrect-syntax-suggestions.rs:43:13
66 LL | let _ = bar().await()?;
67 | ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
69 error: incorrect use of `await`
70 --> $DIR/incorrect-syntax-suggestions.rs:55:13
72 LL | let _ = await bar();
75 | help: `await` is not a statement: `bar().await`
77 error: incorrect use of `await`
78 --> $DIR/incorrect-syntax-suggestions.rs:60:13
80 LL | let _ = await? bar();
83 | help: `await` is not a statement: `bar().await?`
85 error: incorrect use of `await`
86 --> $DIR/incorrect-syntax-suggestions.rs:65:13
88 LL | let _ = await bar()?;
91 | help: `await` is not a statement: `bar()?.await`
93 error: incorrect use of `await`
94 --> $DIR/incorrect-syntax-suggestions.rs:70:14
96 LL | let _ = (await bar())?;
99 | help: `await` is not a statement: `bar().await`
101 error: incorrect use of `await`
102 --> $DIR/incorrect-syntax-suggestions.rs:75:13
104 LL | let _ = bar().await();
105 | ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
107 error: incorrect use of `await`
108 --> $DIR/incorrect-syntax-suggestions.rs:80:13
110 LL | let _ = bar().await()?;
111 | ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
113 error[E0728]: `await` is only allowed inside `async` functions and blocks
114 --> $DIR/incorrect-syntax-suggestions.rs:55:13
116 LL | async fn foo8() -> Result<(), ()> {
117 | --------------------------------- this function is not `async`
119 LL | let _ = await bar();
120 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
122 error[E0728]: `await` is only allowed inside `async` functions and blocks
123 --> $DIR/incorrect-syntax-suggestions.rs:60:13
125 LL | fn foo9() -> Result<(), ()> {
126 | --------------------------- this function is not `async`
128 LL | let _ = await? bar();
129 | ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
131 error[E0728]: `await` is only allowed inside `async` functions and blocks
132 --> $DIR/incorrect-syntax-suggestions.rs:65:13
134 LL | fn foo10() -> Result<(), ()> {
135 | ---------------------------- this function 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 foo11() -> Result<(), ()> {
144 | ---------------------------- this function is not `async`
146 LL | let _ = (await bar())?;
147 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
149 error[E0728]: `await` is only allowed inside `async` functions and blocks
150 --> $DIR/incorrect-syntax-suggestions.rs:75:13
152 LL | fn foo12() -> Result<(), ()> {
153 | ---------------------------- this function is not `async`
155 LL | let _ = bar().await();
156 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
158 error[E0728]: `await` is only allowed inside `async` functions and blocks
159 --> $DIR/incorrect-syntax-suggestions.rs:80:13
161 LL | fn foo13() -> Result<(), ()> {
162 | ---------------------------- this function is not `async`
164 LL | let _ = bar().await()?;
165 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
167 error[E0728]: `await` is only allowed inside `async` functions and blocks
168 --> $DIR/incorrect-syntax-suggestions.rs:85:13
170 LL | fn foo14() -> Result<(), ()> {
171 | ---------------------------- this function is not `async`
173 LL | let _ = bar().await;
174 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
176 error[E0728]: `await` is only allowed inside `async` functions and blocks
177 --> $DIR/incorrect-syntax-suggestions.rs:89:13
179 LL | fn foo15() -> Result<(), ()> {
180 | ---------------------------- this function is not `async`
182 LL | let _ = bar().await?;
183 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
185 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
186 --> $DIR/incorrect-syntax-suggestions.rs:18:19
188 LL | let _ = await bar()?;
189 | ^^^^^^ the `?` operator cannot be applied to type `impl std::future::Future`
191 = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
192 = note: required by `std::ops::Try::into_result`
194 error: aborting due to 24 previous errors
196 For more information about this error, try `rustc --explain E0277`.