aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/code_model.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index f182ab228..afbf78b3b 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -708,7 +708,7 @@ impl Function {
708 Some(SelfParam { func: self.id }) 708 Some(SelfParam { func: self.id })
709 } 709 }
710 710
711 pub fn params(self, db: &dyn HirDatabase) -> Vec<Type> { 711 pub fn params(self, db: &dyn HirDatabase) -> Vec<Param> {
712 let resolver = self.id.resolver(db.upcast()); 712 let resolver = self.id.resolver(db.upcast());
713 let ctx = hir_ty::TyLoweringContext::new(db, &resolver); 713 let ctx = hir_ty::TyLoweringContext::new(db, &resolver);
714 let environment = TraitEnvironment::lower(db, &resolver); 714 let environment = TraitEnvironment::lower(db, &resolver);
@@ -724,7 +724,7 @@ impl Function {
724 environment: environment.clone(), 724 environment: environment.clone(),
725 }, 725 },
726 }; 726 };
727 ty 727 Param { ty }
728 }) 728 })
729 .collect() 729 .collect()
730 } 730 }
@@ -754,6 +754,16 @@ impl From<Mutability> for Access {
754 } 754 }
755} 755}
756 756
757pub struct Param {
758 ty: Type,
759}
760
761impl Param {
762 pub fn ty(&self) -> &Type {
763 &self.ty
764 }
765}
766
757#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 767#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
758pub struct SelfParam { 768pub struct SelfParam {
759 func: FunctionId, 769 func: FunctionId,