File tree 3 files changed +0
-20
lines changed
3 files changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ in a trait produces the following error:
13
13
[ rust-lang/rust#62149 ] : https://github.com/rust-lang/rust/issues/62149
14
14
15
15
``` rust
16
- #![feature(async_await)]
17
-
18
16
trait MyTrait {
19
17
async fn f () {}
20
18
}
@@ -41,8 +39,6 @@ The only thing to notice here is that we write an `#[async_trait]` macro on top
41
39
of traits and trait impls that contain async fn, and then they work.
42
40
43
41
``` rust
44
- #![feature(async_await)]
45
-
46
42
use async_trait :: async_trait;
47
43
48
44
#[async_trait]
Original file line number Diff line number Diff line change 8
8
//! [rust-lang/rust#62149]: https://github.com/rust-lang/rust/issues/62149
9
9
//!
10
10
//! ```compile_fail
11
- //! #![feature(async_await)]
12
- //!
13
11
//! trait MyTrait {
14
12
//! async fn f() {}
15
13
//! }
36
34
//! top of traits and trait impls that contain async fn, and then they work.
37
35
//!
38
36
//! ```
39
- //! #![feature(async_await)]
40
- //!
41
37
//! use async_trait::async_trait;
42
38
//!
43
39
//! #[async_trait]
156
152
//! error message.
157
153
//!
158
154
//! ```compile_fail
159
- //! # #![feature(async_await)]
160
- //! #
161
155
//! # use async_trait::async_trait;
162
156
//! #
163
157
//! type Elided<'a> = &'a usize;
179
173
//! The fix is to name the lifetime or use `'_`.
180
174
//!
181
175
//! ```
182
- //! # #![feature(async_await)]
183
- //! #
184
176
//! # use async_trait::async_trait;
185
177
//! #
186
178
//! # type Elided<'a> = &'a usize;
206
198
//! by value, no associated types, etc.
207
199
//!
208
200
//! ```
209
- //! # #![feature(async_await)]
210
- //! #
211
201
//! # use async_trait::async_trait;
212
202
//! #
213
203
//! #[async_trait]
262
252
//! the default implementations are applicable to them:
263
253
//!
264
254
//! ```
265
- //! # #![feature(async_await)]
266
- //! #
267
255
//! # use async_trait::async_trait;
268
256
//! #
269
257
//! #[async_trait]
285
273
//! bounding them with `Self: Sized`:
286
274
//!
287
275
//! ```
288
- //! # #![feature(async_await)]
289
- //! #
290
276
//! # use async_trait::async_trait;
291
277
//! #
292
278
//! #[async_trait]
Original file line number Diff line number Diff line change 1
- #![ feature( async_await) ]
2
-
3
1
use async_trait:: async_trait;
4
2
5
3
#[ async_trait]
You can’t perform that action at this time.
0 commit comments