mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Extract generic_params method to a HasGenericParams trait
This commit is contained in:
parent
4497e1d3ea
commit
8bcbcc454c
7 changed files with 33 additions and 37 deletions
|
@ -9,12 +9,13 @@ use ra_syntax::{
|
|||
|
||||
use crate::{
|
||||
Const, TypeAlias, Function, HirFileId,
|
||||
HirDatabase, DefDatabase,
|
||||
HirDatabase, DefDatabase, TraitRef,
|
||||
type_ref::TypeRef,
|
||||
ids::LocationCtx,
|
||||
resolve::Resolver,
|
||||
ty::Ty, generics::GenericParams,
|
||||
TraitRef, code_model_api::{Module, ModuleSource}
|
||||
ty::Ty,
|
||||
generics::HasGenericParams,
|
||||
code_model_api::{Module, ModuleSource}
|
||||
};
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq)]
|
||||
|
@ -92,10 +93,6 @@ impl ImplBlock {
|
|||
db.impls_in_module(self.module).impls[self.impl_id].items().to_vec()
|
||||
}
|
||||
|
||||
pub fn generic_params(&self, db: &impl DefDatabase) -> Arc<GenericParams> {
|
||||
db.generic_params((*self).into())
|
||||
}
|
||||
|
||||
pub(crate) fn resolver(&self, db: &impl DefDatabase) -> Resolver {
|
||||
let r = self.module().resolver(db);
|
||||
// add generic params, if present
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue