From cb3ef552e873a86e94a3792160fadb5d937a6f5f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 30 Apr 2021 11:52:31 +0300 Subject: internal: normalize name All def types in hir are unsubstituted --- crates/hir/src/display.rs | 2 +- crates/hir/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir/src') diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index 01a4d205f..508ac37c2 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs @@ -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) } } diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 0acfa582a..9eb7672da 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -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(), -- cgit v1.2.3 From 1a01a5ae190ad02e44c3550ac0336b1f0983be51 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 30 Apr 2021 11:55:59 +0300 Subject: internal: fix naming polarity Type Constructors have *parameters*, when they are substituted with type *arguments*, we have a type. --- crates/hir/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir/src') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 9eb7672da..d8ccfde0c 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1984,7 +1984,7 @@ impl Type { None } - pub fn type_parameters(&self) -> impl Iterator + '_ { + pub fn type_arguments(&self) -> impl Iterator + '_ { self.ty .strip_references() .as_adt() -- cgit v1.2.3