Simplify SourceBinder

This commit is contained in:
Aleksey Kladov 2020-02-29 18:32:18 +01:00
parent a6a623dfbb
commit 28332d9b63
6 changed files with 321 additions and 349 deletions

View file

@ -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 }
}
}