aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 0acfa582a..6fcc58f61 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -509,7 +509,7 @@ impl Field {
509 /// placeholder types for type parameters). This is good for showing 509 /// placeholder types for type parameters). This is good for showing
510 /// signature help, but not so good to actually get the type of the field 510 /// signature help, but not so good to actually get the type of the field
511 /// when you actually have a variable of the struct. 511 /// when you actually have a variable of the struct.
512 pub fn signature_ty(&self, db: &dyn HirDatabase) -> Type { 512 pub fn ty(&self, db: &dyn HirDatabase) -> Type {
513 let var_id = self.parent.into(); 513 let var_id = self.parent.into();
514 let generic_def_id: GenericDefId = match self.parent { 514 let generic_def_id: GenericDefId = match self.parent {
515 VariantDef::Struct(it) => it.id.into(), 515 VariantDef::Struct(it) => it.id.into(),
@@ -1744,6 +1744,10 @@ impl Type {
1744 } 1744 }
1745 } 1745 }
1746 1746
1747 pub fn strip_references(&self) -> Type {
1748 self.derived(self.ty.strip_references().clone())
1749 }
1750
1747 pub fn is_unknown(&self) -> bool { 1751 pub fn is_unknown(&self) -> bool {
1748 self.ty.is_unknown() 1752 self.ty.is_unknown()
1749 } 1753 }
@@ -1984,7 +1988,7 @@ impl Type {
1984 None 1988 None
1985 } 1989 }
1986 1990
1987 pub fn type_parameters(&self) -> impl Iterator<Item = Type> + '_ { 1991 pub fn type_arguments(&self) -> impl Iterator<Item = Type> + '_ {
1988 self.ty 1992 self.ty
1989 .strip_references() 1993 .strip_references()
1990 .as_adt() 1994 .as_adt()