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