internal: normalize name
All def types in hir are unsubstituted
This commit is contained in:
@@ -170,7 +170,7 @@ impl HirDisplay for Field {
|
||||
fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
|
||||
write_visibility(self.parent.module(f.db).id, self.visibility(f.db), f)?;
|
||||
write!(f, "{}: ", self.name(f.db))?;
|
||||
self.signature_ty(f.db).hir_fmt(f)
|
||||
self.ty(f.db).hir_fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ impl Field {
|
||||
/// placeholder types for type parameters). This is good for showing
|
||||
/// signature help, but not so good to actually get the type of the field
|
||||
/// when you actually have a variable of the struct.
|
||||
pub fn signature_ty(&self, db: &dyn HirDatabase) -> Type {
|
||||
pub fn ty(&self, db: &dyn HirDatabase) -> Type {
|
||||
let var_id = self.parent.into();
|
||||
let generic_def_id: GenericDefId = match self.parent {
|
||||
VariantDef::Struct(it) => it.id.into(),
|
||||
|
||||
Reference in New Issue
Block a user