+ /// Return the `LocalDefId` of this variant's constructor, if it has one.
+ pub fn ctor_def_id(&self) -> Option<LocalDefId> {
+ match *self {
+ VariantData::Struct(_, _) => None,
+ VariantData::Tuple(_, _, def_id) | VariantData::Unit(_, def_id) => Some(def_id),
+ }
+ }
+