Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs b/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs
index 58d1b7f31d..836059cb9b 100644
--- a/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs
+++ b/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs
@@ -13,6 +13,7 @@ pub(crate) fn trait_impl_missing_assoc_item(
) -> Diagnostic {
let missing = d.missing.iter().format_with(", ", |(name, item), f| {
f(&match *item {
+ hir::AssocItem::Function(func) if func.is_async(ctx.sema.db) => "`async fn ",
hir::AssocItem::Function(_) => "`fn ",
hir::AssocItem::Const(_) => "`const ",
hir::AssocItem::TypeAlias(_) => "`type ",
@@ -56,22 +57,25 @@ trait Trait {
const C: ();
type T;
fn f();
+ async fn async_f();
}
impl Trait for () {
const C: () = ();
type T = ();
fn f() {}
+ async fn async_f() {}
}
impl Trait for () {
//^^^^^ error: not all trait items implemented, missing: `const C`
type T = ();
fn f() {}
+ async fn async_f() {}
}
impl Trait for () {
- //^^^^^ error: not all trait items implemented, missing: `const C`, `type T`, `fn f`
+ //^^^^^ error: not all trait items implemented, missing: `const C`, `type T`, `fn f`, `async fn async_f`
}
"#,