diff --git a/src/librustc_error_codes/error_codes/E0706.md b/src/librustc_error_codes/error_codes/E0706.md index 909b08fb174..bee9219af7c 100644 --- a/src/librustc_error_codes/error_codes/E0706.md +++ b/src/librustc_error_codes/error_codes/E0706.md @@ -42,28 +42,7 @@ impl MyDatabase { Until these issues are resolved, you can use the [`async-trait` crate], allowing you to use `async fn` in traits by desugaring to "boxed futures" -(`Pin>`): - -```edition2018,ignore (example-of-desugaring-equivalence) -#[async_trait] -impl MyDatabase { - async fn get_user(&self) -> User { - unimplemented!() - } -} - -// The annotated impl above gets desugared as follows: -impl MyDatabase { - fn get_user<'async>( - &'async self, - ) -> Pin + Send + 'async>> - where - Self: Sync + 'async, - { - unimplemented!() - } -} -``` +(`Pin>`). Note that using these trait methods will result in a heap allocation per-function-call. This is not a significant cost for the vast majority of applications, but should be considered when deciding