mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Fix error message
This commit is contained in:
parent
94244a7a11
commit
752c49b679
1 changed files with 5 additions and 1 deletions
|
@ -13,6 +13,7 @@ pub(crate) fn trait_impl_missing_assoc_item(
|
||||||
) -> Diagnostic {
|
) -> Diagnostic {
|
||||||
let missing = d.missing.iter().format_with(", ", |(name, item), f| {
|
let missing = d.missing.iter().format_with(", ", |(name, item), f| {
|
||||||
f(&match *item {
|
f(&match *item {
|
||||||
|
hir::AssocItem::Function(func) if func.is_async(ctx.sema.db) => "`async fn ",
|
||||||
hir::AssocItem::Function(_) => "`fn ",
|
hir::AssocItem::Function(_) => "`fn ",
|
||||||
hir::AssocItem::Const(_) => "`const ",
|
hir::AssocItem::Const(_) => "`const ",
|
||||||
hir::AssocItem::TypeAlias(_) => "`type ",
|
hir::AssocItem::TypeAlias(_) => "`type ",
|
||||||
|
@ -56,22 +57,25 @@ trait Trait {
|
||||||
const C: ();
|
const C: ();
|
||||||
type T;
|
type T;
|
||||||
fn f();
|
fn f();
|
||||||
|
async fn async_f();
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Trait for () {
|
impl Trait for () {
|
||||||
const C: () = ();
|
const C: () = ();
|
||||||
type T = ();
|
type T = ();
|
||||||
fn f() {}
|
fn f() {}
|
||||||
|
async fn async_f() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Trait for () {
|
impl Trait for () {
|
||||||
//^^^^^ error: not all trait items implemented, missing: `const C`
|
//^^^^^ error: not all trait items implemented, missing: `const C`
|
||||||
type T = ();
|
type T = ();
|
||||||
fn f() {}
|
fn f() {}
|
||||||
|
async fn async_f() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Trait for () {
|
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`
|
||||||
}
|
}
|
||||||
|
|
||||||
"#,
|
"#,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue