diff options
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index e8f3482fe..ccc4348f4 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs | |||
@@ -427,6 +427,11 @@ impl Substs { | |||
427 | } | 427 | } |
428 | } | 428 | } |
429 | 429 | ||
430 | /// Return an index of a parameter in the generic type parameter list by it's id. | ||
431 | pub fn param_idx(db: &dyn HirDatabase, id: TypeParamId) -> Option<usize> { | ||
432 | generics(db.upcast(), id.parent).param_idx(id) | ||
433 | } | ||
434 | |||
430 | #[derive(Debug, Clone)] | 435 | #[derive(Debug, Clone)] |
431 | pub struct SubstsBuilder { | 436 | pub struct SubstsBuilder { |
432 | vec: Vec<Ty>, | 437 | vec: Vec<Ty>, |