Skip to content

Commit 5b184ff

Browse files
committed
Fix error message
1 parent 55c703b commit 5b184ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub(crate) fn trait_impl_missing_assoc_item(
1313
) -> Diagnostic {
1414
let missing = d.missing.iter().format_with(", ", |(name, item), f| {
1515
f(&match *item {
16+
hir::AssocItem::Function(func) if func.is_async(ctx.sema.db) => "`async fn ",
1617
hir::AssocItem::Function(_) => "`fn ",
1718
hir::AssocItem::Const(_) => "`const ",
1819
hir::AssocItem::TypeAlias(_) => "`type ",
@@ -56,22 +57,25 @@ trait Trait {
5657
const C: ();
5758
type T;
5859
fn f();
60+
async fn async_f();
5961
}
6062
6163
impl Trait for () {
6264
const C: () = ();
6365
type T = ();
6466
fn f() {}
67+
async fn async_f() {}
6568
}
6669
6770
impl Trait for () {
6871
//^^^^^ error: not all trait items implemented, missing: `const C`
6972
type T = ();
7073
fn f() {}
74+
async fn async_f() {}
7175
}
7276
7377
impl Trait for () {
74-
//^^^^^ error: not all trait items implemented, missing: `const C`, `type T`, `fn f`
78+
//^^^^^ error: not all trait items implemented, missing: `const C`, `type T`, `fn f`, `async fn async_f`
7579
}
7680
7781
"#,

0 commit comments

Comments
 (0)