]> git.lizzy.rs Git - rust.git/blob - src/test/ui/await-keyword/incorrect-syntax-suggestions.stderr
f39ccfcc95c893769a57387cb83b716ad8bc2d0f
[rust.git] / src / test / ui / await-keyword / incorrect-syntax-suggestions.stderr
1 error: incorrect use of `await`
2   --> $DIR/incorrect-syntax-suggestions.rs:10:13
3    |
4 LL |     let _ = await bar();
5    |             ^^^^^------
6    |             |
7    |             help: `await` is not a statement: `bar().await`
8
9 error: incorrect use of `await`
10   --> $DIR/incorrect-syntax-suggestions.rs:14:13
11    |
12 LL |     let _ = await? bar();
13    |             ^^^^^-------
14    |             |
15    |             help: `await` is not a statement: `bar().await?`
16
17 error: incorrect use of `await`
18   --> $DIR/incorrect-syntax-suggestions.rs:18:13
19    |
20 LL |     let _ = await bar()?;
21    |             ^^^^^-------
22    |             |
23    |             help: `await` is not a statement: `bar()?.await`
24
25 error: incorrect use of `await`
26   --> $DIR/incorrect-syntax-suggestions.rs:23:13
27    |
28 LL |     let _ = await { bar() };
29    |             ^^^^^----------
30    |             |
31    |             help: `await` is not a statement: `{ bar() }.await`
32
33 error: incorrect use of `await`
34   --> $DIR/incorrect-syntax-suggestions.rs:27:13
35    |
36 LL |     let _ = await(bar());
37    |             ^^^^^-------
38    |             |
39    |             help: `await` is not a statement: `(bar()).await`
40
41 error: incorrect use of `await`
42   --> $DIR/incorrect-syntax-suggestions.rs:31:13
43    |
44 LL |     let _ = await { bar() }?;
45    |             ^^^^^----------
46    |             |
47    |             help: `await` is not a statement: `{ bar() }.await`
48
49 error: incorrect use of `await`
50   --> $DIR/incorrect-syntax-suggestions.rs:35:14
51    |
52 LL |     let _ = (await bar())?;
53    |              ^^^^^------
54    |              |
55    |              help: `await` is not a statement: `bar().await`
56
57 error: incorrect use of `await`
58   --> $DIR/incorrect-syntax-suggestions.rs:39:13
59    |
60 LL |     let _ = bar().await();
61    |             ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
62
63 error: incorrect use of `await`
64   --> $DIR/incorrect-syntax-suggestions.rs:43:13
65    |
66 LL |     let _ = bar().await()?;
67    |             ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
68
69 error: incorrect use of `await`
70   --> $DIR/incorrect-syntax-suggestions.rs:55:13
71    |
72 LL |     let _ = await bar();
73    |             ^^^^^------
74    |             |
75    |             help: `await` is not a statement: `bar().await`
76
77 error: incorrect use of `await`
78   --> $DIR/incorrect-syntax-suggestions.rs:60:13
79    |
80 LL |     let _ = await? bar();
81    |             ^^^^^-------
82    |             |
83    |             help: `await` is not a statement: `bar().await?`
84
85 error: incorrect use of `await`
86   --> $DIR/incorrect-syntax-suggestions.rs:65:13
87    |
88 LL |     let _ = await bar()?;
89    |             ^^^^^-------
90    |             |
91    |             help: `await` is not a statement: `bar()?.await`
92
93 error: incorrect use of `await`
94   --> $DIR/incorrect-syntax-suggestions.rs:70:14
95    |
96 LL |     let _ = (await bar())?;
97    |              ^^^^^------
98    |              |
99    |              help: `await` is not a statement: `bar().await`
100
101 error: incorrect use of `await`
102   --> $DIR/incorrect-syntax-suggestions.rs:75:13
103    |
104 LL |     let _ = bar().await();
105    |             ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
106
107 error: incorrect use of `await`
108   --> $DIR/incorrect-syntax-suggestions.rs:80:13
109    |
110 LL |     let _ = bar().await()?;
111    |             ^^^^^^^^^^^-- help: `await` is not a method call, remove the parentheses
112
113 error[E0728]: `await` is only allowed inside `async` functions and blocks
114   --> $DIR/incorrect-syntax-suggestions.rs:55:13
115    |
116 LL | async fn foo8() -> Result<(), ()> {
117    | --------------------------------- this function is not `async`
118 ...
119 LL |     let _ = await bar();
120    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
121
122 error[E0728]: `await` is only allowed inside `async` functions and blocks
123   --> $DIR/incorrect-syntax-suggestions.rs:60:13
124    |
125 LL | fn foo9() -> Result<(), ()> {
126    | --------------------------- this function is not `async`
127 ...
128 LL |     let _ = await? bar();
129    |             ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
130
131 error[E0728]: `await` is only allowed inside `async` functions and blocks
132   --> $DIR/incorrect-syntax-suggestions.rs:65:13
133    |
134 LL | fn foo10() -> Result<(), ()> {
135    | ---------------------------- this function is not `async`
136 ...
137 LL |     let _ = await bar()?;
138    |             ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
139
140 error[E0728]: `await` is only allowed inside `async` functions and blocks
141   --> $DIR/incorrect-syntax-suggestions.rs:70:14
142    |
143 LL | fn foo11() -> Result<(), ()> {
144    | ---------------------------- this function is not `async`
145 ...
146 LL |     let _ = (await bar())?;
147    |              ^^^^^^^^^^^ only allowed inside `async` functions and blocks
148
149 error[E0728]: `await` is only allowed inside `async` functions and blocks
150   --> $DIR/incorrect-syntax-suggestions.rs:75:13
151    |
152 LL | fn foo12() -> Result<(), ()> {
153    | ---------------------------- this function is not `async`
154 ...
155 LL |     let _ = bar().await();
156    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
157
158 error[E0728]: `await` is only allowed inside `async` functions and blocks
159   --> $DIR/incorrect-syntax-suggestions.rs:80:13
160    |
161 LL | fn foo13() -> Result<(), ()> {
162    | ---------------------------- this function is not `async`
163 ...
164 LL |     let _ = bar().await()?;
165    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
166
167 error[E0728]: `await` is only allowed inside `async` functions and blocks
168   --> $DIR/incorrect-syntax-suggestions.rs:85:13
169    |
170 LL | fn foo14() -> Result<(), ()> {
171    | ---------------------------- this function is not `async`
172 ...
173 LL |     let _ = bar().await;
174    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
175
176 error[E0728]: `await` is only allowed inside `async` functions and blocks
177   --> $DIR/incorrect-syntax-suggestions.rs:89:13
178    |
179 LL | fn foo15() -> Result<(), ()> {
180    | ---------------------------- this function is not `async`
181 ...
182 LL |     let _ = bar().await?;
183    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
184
185 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
186   --> $DIR/incorrect-syntax-suggestions.rs:18:19
187    |
188 LL |     let _ = await bar()?;
189    |                   ^^^^^^ the `?` operator cannot be applied to type `impl std::future::Future`
190    |
191    = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
192    = note: required by `std::ops::Try::into_result`
193
194 error: aborting due to 24 previous errors
195
196 For more information about this error, try `rustc --explain E0277`.