Track labels in the HIR
This commit is contained in:
@@ -4,12 +4,15 @@
|
||||
//! are splitting the hir.
|
||||
|
||||
use hir_def::{
|
||||
expr::PatId, item_scope::ItemInNs, AdtId, AssocItemId, DefWithBodyId, EnumVariantId, FieldId,
|
||||
GenericDefId, ModuleDefId, VariantId,
|
||||
expr::{LabelId, PatId},
|
||||
item_scope::ItemInNs,
|
||||
AdtId, AssocItemId, DefWithBodyId, EnumVariantId, FieldId, GenericDefId, ModuleDefId,
|
||||
VariantId,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
Adt, AssocItem, DefWithBody, Field, GenericDef, Local, MacroDef, ModuleDef, Variant, VariantDef,
|
||||
Adt, AssocItem, DefWithBody, Field, GenericDef, Label, Local, MacroDef, ModuleDef, Variant,
|
||||
VariantDef,
|
||||
};
|
||||
|
||||
macro_rules! from_id {
|
||||
@@ -228,6 +231,12 @@ impl From<(DefWithBodyId, PatId)> for Local {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<(DefWithBodyId, LabelId)> for Label {
|
||||
fn from((parent, label_id): (DefWithBodyId, LabelId)) -> Self {
|
||||
Label { parent, label_id }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MacroDef> for ItemInNs {
|
||||
fn from(macro_def: MacroDef) -> Self {
|
||||
ItemInNs::Macros(macro_def.into())
|
||||
|
||||
Reference in New Issue
Block a user