PrimTy(hir::PrimTy),
TyParam(DefId),
SelfTy(Option<DefId> /* trait */, Option<DefId> /* impl */),
+ ToolMod, // e.g. `rustfmt` in `#[rustfmt::skip]`
// Value namespace
Fn(DefId),
// Macro namespace
Macro(DefId, MacroKind),
+ NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]`
GlobalAsm(DefId),
Def::Label(..) |
Def::PrimTy(..) |
Def::SelfTy(..) |
+ Def::ToolMod |
+ Def::NonMacroAttr |
Def::Err => {
bug!("attempted .def_id() on invalid def: {:?}", self)
}
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",
}
}