mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
internal: Replace Display impl for Name
This commit is contained in:
parent
2f840c2236
commit
c7ef6c25b7
108 changed files with 1045 additions and 656 deletions
|
@ -31,7 +31,7 @@ use crate::{fix, Diagnostic, DiagnosticsContext};
|
|||
pub(crate) fn missing_fields(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Diagnostic {
|
||||
let mut message = String::from("missing structure fields:\n");
|
||||
for field in &d.missed_fields {
|
||||
format_to!(message, "- {}\n", field);
|
||||
format_to!(message, "- {}\n", field.display(ctx.sema.db));
|
||||
}
|
||||
|
||||
let ptr = InFile::new(
|
||||
|
@ -175,7 +175,7 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Option<Vec<Ass
|
|||
|
||||
fn make_ty(ty: &hir::Type, db: &dyn HirDatabase, module: hir::Module) -> ast::Type {
|
||||
let ty_str = match ty.as_adt() {
|
||||
Some(adt) => adt.name(db).to_string(),
|
||||
Some(adt) => adt.name(db).display(db.upcast()).to_string(),
|
||||
None => {
|
||||
ty.display_source_code(db, module.into(), false).ok().unwrap_or_else(|| "_".to_string())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue