mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Remove old hir::generics module
This commit is contained in:
parent
4f8f3393bc
commit
4daf931111
11 changed files with 94 additions and 114 deletions
|
@ -9,8 +9,9 @@ use hir_def::{
|
|||
};
|
||||
|
||||
use crate::{
|
||||
ty::TypableDef, Adt, AssocItem, Const, Crate, DefWithBody, EnumVariant, Function, GenericDef,
|
||||
ModuleDef, Static, TypeAlias,
|
||||
ty::{CallableDef, TypableDef},
|
||||
Adt, AssocItem, Const, Crate, DefWithBody, EnumVariant, Function, GenericDef, ModuleDef,
|
||||
Static, TypeAlias,
|
||||
};
|
||||
|
||||
impl From<ra_db::CrateId> for Crate {
|
||||
|
@ -206,3 +207,15 @@ impl From<Adt> for GenericDefId {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CallableDef> for GenericDefId {
|
||||
fn from(def: CallableDef) -> Self {
|
||||
match def {
|
||||
CallableDef::Function(it) => it.id.into(),
|
||||
CallableDef::Struct(it) => it.id.into(),
|
||||
CallableDef::EnumVariant(it) => {
|
||||
EnumVariantId { parent: it.parent.id, local_id: it.id }.into()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue