1
Fork 0

Make missing impl item suggestions more obvious that they're missing

This commit is contained in:
Michael Goulet 2023-04-19 17:22:16 +00:00
parent 204c516293
commit 73038d3a64
10 changed files with 41 additions and 51 deletions

View file

@ -466,10 +466,10 @@ fn suggestion_signature<'tcx>(
assoc,
)
}
ty::AssocKind::Type => format!("type {} = Type;", assoc.name),
ty::AssocKind::Type => format!("type {} = /* Type */;", assoc.name),
ty::AssocKind::Const => {
let ty = tcx.type_of(assoc.def_id).subst_identity();
let val = ty_kind_suggestion(ty).unwrap_or("value");
let val = ty_kind_suggestion(ty).unwrap_or("todo!()");
format!("const {}: {} = {};", assoc.name, ty, val)
}
}