Macro(DefId, MacroKind),
NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]`
- GlobalAsm(DefId),
-
// Both namespaces
Err,
}
Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) |
Def::AssociatedConst(id) | Def::Macro(id, ..) |
- Def::Existential(id) | Def::AssociatedExistential(id) |
- Def::GlobalAsm(id) | Def::TyForeign(id) => {
+ Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => {
id
}
Def::Label(..) => "label",
Def::SelfTy(..) => "self type",
Def::Macro(.., macro_kind) => macro_kind.descr(),
- Def::GlobalAsm(..) => "global asm",
Def::ToolMod => "tool module",
Def::NonMacroAttr => "non-macro attribute",
Def::Err => "unresolved item",
ItemKind::Const(..) => Some(Def::Const(def_id())),
ItemKind::Fn(..) => Some(Def::Fn(def_id())),
ItemKind::Mod(..) => Some(Def::Mod(def_id())),
- ItemKind::GlobalAsm(..) => Some(Def::GlobalAsm(def_id())),
ItemKind::Existential(..) => Some(Def::Existential(def_id())),
ItemKind::Ty(..) => Some(Def::TyAlias(def_id())),
ItemKind::Enum(..) => Some(Def::Enum(def_id())),
ItemKind::ExternCrate(_) |
ItemKind::Use(..) |
ItemKind::ForeignMod(..) |
+ ItemKind::GlobalAsm(..) |
ItemKind::Impl(..) => None,
}
}
Upvar(def_id, index, expr_id),
Label(node_id),
Macro(def_id, macro_kind),
- GlobalAsm(def_id),
ToolMod,
NonMacroAttr,
Err
EntryKind::Trait(_) => Def::Trait(did),
EntryKind::Enum(..) => Def::Enum(did),
EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang),
- EntryKind::GlobalAsm => Def::GlobalAsm(did),
EntryKind::ForeignType => Def::TyForeign(did),
EntryKind::ForeignMod |
+ EntryKind::GlobalAsm |
EntryKind::Impl(_) |
EntryKind::Field |
EntryKind::Generator(_) |
HirDef::SelfTy(..) |
HirDef::Label(..) |
HirDef::Macro(..) |
- HirDef::GlobalAsm(..) |
HirDef::ToolMod |
HirDef::NonMacroAttr |
HirDef::Err => None,