From 04fc937700105951442a9b6fa30591fb48a1e879 Mon Sep 17 00:00:00 2001 From: adamrk Date: Tue, 1 Sep 2020 22:13:12 +0200 Subject: Add back Param struct --- crates/hir/src/code_model.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'crates/hir') 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 { Some(SelfParam { func: self.id }) } - pub fn params(self, db: &dyn HirDatabase) -> Vec { + pub fn params(self, db: &dyn HirDatabase) -> Vec { let resolver = self.id.resolver(db.upcast()); let ctx = hir_ty::TyLoweringContext::new(db, &resolver); let environment = TraitEnvironment::lower(db, &resolver); @@ -724,7 +724,7 @@ impl Function { environment: environment.clone(), }, }; - ty + Param { ty } }) .collect() } @@ -754,6 +754,16 @@ impl From for Access { } } +pub struct Param { + ty: Type, +} + +impl Param { + pub fn ty(&self) -> &Type { + &self.ty + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct SelfParam { func: FunctionId, -- cgit v1.2.3