From 99c18c417adc69113002c07e4d7bdfc48be62869 Mon Sep 17 00:00:00 2001 From: Agustin Fernandez Date: Tue, 29 Oct 2019 11:48:14 -0400 Subject: [PATCH] Add more context to `async fn` trait error. Suggest `async-trait`. --- src/librustc_passes/ast_validation.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index 994e9405fb643..08f6e6fe0e716 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -244,7 +244,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(); } }