pub enum Def {
DefFn(DefId, bool),
DefStaticMethod(DefId, MethodProvenance),
DefSelfTy(u32),
DefMod(DefId),
DefForeignMod(DefId),
DefStatic(DefId, bool),
DefConst(DefId),
DefLocal(u32),
DefVariant(DefId, DefId, bool),
DefTy(DefId, bool),
DefAssociatedTy(DefId),
DefAssociatedPath(TyParamProvenance, Ident),
DefTrait(DefId),
DefPrimTy(PrimTy),
DefTyParam(ParamSpace, u32, DefId, Name),
DefUse(DefId),
DefUpvar(u32, u32, u32),
DefStruct(DefId),
DefTyParamBinder(u32),
DefRegion(u32),
DefLabel(u32),
DefMethod(DefId, Option<DefId>, MethodProvenance),
}
Variants
DefFn | |
DefStaticMethod | |
DefSelfTy | |
DefMod | |
DefForeignMod | |
DefStatic | |
DefConst | |
DefLocal | |
DefVariant | |
DefTy | |
DefAssociatedTy | |
DefAssociatedPath | |
DefTrait | |
DefPrimTy | |
DefTyParam | |
DefUse | |
DefUpvar | |
DefStruct | Note that if it's a tuple struct's definition, the node id of the ast::DefId
may either refer to the item definition's id or the StructDef.ctor_id.
The cases that I have encountered so far are (this is not exhaustive):
- If it's a ty_path referring to some tuple struct, then DefMap maps
it to a def whose id is the item definition's id.
- If it's an ExprPath referring to some tuple struct, then DefMap maps
it to a def whose id is the StructDef.ctor_id.
|
DefTyParamBinder | |
DefRegion | |
DefLabel | |
DefMethod | |
Methods
Trait Implementations
impl<'tcx> Repr<'tcx> for Def
Derived Implementations
fn hash(&self, __arg_0: &mut __S)