Skip to content

Commit

Permalink
Add more context to async fn trait error. Suggest async-trait.
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustin Fernandez committed Oct 29, 2019
1 parent eb5ef81 commit 99c18c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc_passes/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 99c18c4

Please sign in to comment.