mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Add LifetimeParam resolving to Semantics
This commit is contained in:
parent
dbd0cfba53
commit
c6172f3f6d
8 changed files with 131 additions and 39 deletions
|
@ -41,6 +41,7 @@ from_id![
|
|||
(hir_def::FunctionId, crate::Function),
|
||||
(hir_def::ImplId, crate::ImplDef),
|
||||
(hir_def::TypeParamId, crate::TypeParam),
|
||||
(hir_def::LifetimeParamId, crate::LifetimeParam),
|
||||
(hir_expand::MacroDefId, crate::MacroDef)
|
||||
];
|
||||
|
||||
|
@ -154,6 +155,22 @@ impl From<GenericDef> for GenericDefId {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<GenericDefId> for GenericDef {
|
||||
fn from(def: GenericDefId) -> Self {
|
||||
match def {
|
||||
GenericDefId::FunctionId(it) => GenericDef::Function(it.into()),
|
||||
GenericDefId::AdtId(it) => GenericDef::Adt(it.into()),
|
||||
GenericDefId::TraitId(it) => GenericDef::Trait(it.into()),
|
||||
GenericDefId::TypeAliasId(it) => GenericDef::TypeAlias(it.into()),
|
||||
GenericDefId::ImplId(it) => GenericDef::ImplDef(it.into()),
|
||||
GenericDefId::EnumVariantId(it) => {
|
||||
GenericDef::EnumVariant(EnumVariant { parent: it.parent.into(), id: it.local_id })
|
||||
}
|
||||
GenericDefId::ConstId(it) => GenericDef::Const(it.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Adt> for GenericDefId {
|
||||
fn from(id: Adt) -> Self {
|
||||
match id {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue