File tree Expand file tree Collapse file tree 3 files changed +0
-20
lines changed Expand file tree Collapse file tree 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:
1313[ rust-lang/rust#62149 ] : https://github.com/rust-lang/rust/issues/62149
1414
1515``` rust
16- #![feature(async_await)]
17-
1816trait MyTrait {
1917 async fn f () {}
2018}
@@ -41,8 +39,6 @@ The only thing to notice here is that we write an `#[async_trait]` macro on top
4139of traits and trait impls that contain async fn, and then they work.
4240
4341``` rust
44- #![feature(async_await)]
45-
4642use async_trait :: async_trait;
4743
4844#[async_trait]
Original file line number Diff line number Diff line change 88//! [rust-lang/rust#62149]: https://github.com/rust-lang/rust/issues/62149
99//!
1010//! ```compile_fail
11- //! #![feature(async_await)]
12- //!
1311//! trait MyTrait {
1412//! async fn f() {}
1513//! }
3634//! top of traits and trait impls that contain async fn, and then they work.
3735//!
3836//! ```
39- //! #![feature(async_await)]
40- //!
4137//! use async_trait::async_trait;
4238//!
4339//! #[async_trait]
156152//! error message.
157153//!
158154//! ```compile_fail
159- //! # #![feature(async_await)]
160- //! #
161155//! # use async_trait::async_trait;
162156//! #
163157//! type Elided<'a> = &'a usize;
179173//! The fix is to name the lifetime or use `'_`.
180174//!
181175//! ```
182- //! # #![feature(async_await)]
183- //! #
184176//! # use async_trait::async_trait;
185177//! #
186178//! # type Elided<'a> = &'a usize;
206198//! by value, no associated types, etc.
207199//!
208200//! ```
209- //! # #![feature(async_await)]
210- //! #
211201//! # use async_trait::async_trait;
212202//! #
213203//! #[async_trait]
262252//! the default implementations are applicable to them:
263253//!
264254//! ```
265- //! # #![feature(async_await)]
266- //! #
267255//! # use async_trait::async_trait;
268256//! #
269257//! #[async_trait]
285273//! bounding them with `Self: Sized`:
286274//!
287275//! ```
288- //! # #![feature(async_await)]
289- //! #
290276//! # use async_trait::async_trait;
291277//! #
292278//! #[async_trait]
Original file line number Diff line number Diff line change 1- #![ feature( async_await) ]
2-
31use async_trait:: async_trait;
42
53#[ async_trait]
You can’t perform that action at this time.
0 commit comments