From 12bf008ab12f87b2e6d4805681f5a389d9e2f425 Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Thu, 14 May 2020 13:47:36 +0300 Subject: Adds a param_idx helper --- crates/ra_hir/src/code_model.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 3936f5aaa..cdbf475b3 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -992,8 +992,8 @@ impl TypeParam { pub fn default(self, db: &dyn HirDatabase) -> Option { let params = db.generic_defaults(self.id.parent); - let local_idx: u32 = self.id.local_id.into_raw().into(); - params.get(local_idx as usize).map(|d| d.clone()) + let local_idx = hir_ty::param_idx(db, self.id)?; + params.get(local_idx).map(|d| d.clone()) } } -- cgit v1.2.3