Skip to content

Commit aae7630

Browse files
Agustin Fernandezestebank
Agustin Fernandez
authored andcommitted
Add more context to async fn trait error. Suggest async-trait.
1 parent a0d40f8 commit aae7630

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_passes/ast_validation.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ impl<'a> AstValidator<'a> {
174174
fn check_trait_fn_not_async(&self, span: Span, asyncness: IsAsync) {
175175
if asyncness.is_async() {
176176
struct_span_err!(self.session, span, E0706,
177-
"trait fns cannot be declared `async`").emit()
177+
"trait fns cannot be declared `async`")
178+
.note("Due to technical restrictions rust does not currently support `async` \
179+
trait fns.")
180+
.note("Consider using the `async-trait` crate in the meantime until further \
181+
notice.")
182+
.emit();
178183
}
179184
}
180185

0 commit comments

Comments
 (0)