diff options
| author | Agustin Fernandez <juan.fernandez@opower.com> | 2019-10-29 11:48:14 -0400 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-11-18 12:08:15 -0800 |
| commit | aae76304f98e4830c405b2ae16821ddcdf03c2b9 (patch) | |
| tree | e2bd9092a0d1b6838c24b24ebef63ad36a280b65 | |
| parent | a0d40f8bdfcc3c28355467973f97fd4c45ac5876 (diff) | |
Add more context to `async fn` trait error. Suggest `async-trait`.
| -rw-r--r-- | src/librustc_passes/ast_validation.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index edb91d5bf18..b7ec2893bb3 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -174,7 +174,12 @@ impl<'a> AstValidator<'a> { fn check_trait_fn_not_async(&self, span: Span, asyncness: IsAsync) { if asyncness.is_async() { struct_span_err!(self.session, span, E0706, - "trait fns cannot be declared `async`").emit() + "trait fns cannot be declared `async`") + .note("Due to technical restrictions rust does not currently support `async` \ + trait fns.") + .note("Consider using the `async-trait` crate in the meantime until further \ + notice.") + .emit(); } } |
