mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Simplify SourceBinder
This commit is contained in:
parent
a6a623dfbb
commit
28332d9b63
6 changed files with 321 additions and 349 deletions
|
@ -4,12 +4,12 @@
|
|||
//! are splitting the hir.
|
||||
|
||||
use hir_def::{
|
||||
AdtId, AssocItemId, AttrDefId, DefWithBodyId, EnumVariantId, GenericDefId, ModuleDefId,
|
||||
StructFieldId, VariantId,
|
||||
expr::PatId, AdtId, AssocItemId, AttrDefId, DefWithBodyId, EnumVariantId, GenericDefId,
|
||||
ModuleDefId, StructFieldId, VariantId,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
Adt, AssocItem, AttrDef, DefWithBody, EnumVariant, GenericDef, ModuleDef, StructField,
|
||||
Adt, AssocItem, AttrDef, DefWithBody, EnumVariant, GenericDef, Local, ModuleDef, StructField,
|
||||
VariantDef,
|
||||
};
|
||||
|
||||
|
@ -222,3 +222,9 @@ impl From<AssocItem> for GenericDefId {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<(DefWithBodyId, PatId)> for Local {
|
||||
fn from((parent, pat_id): (DefWithBodyId, PatId)) -> Self {
|
||||
Local { parent: parent.into(), pat_id }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue