@@ -13,8 +13,7 @@ use std::array::IntoIter;
1313use std:: fmt:: Debug ;
1414
1515/// Encodes if a `DefKind::Ctor` is the constructor of an enum variant or a struct.
16- #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug ) ]
17- #[ derive( HashStable_Generic ) ]
16+ #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug , HashStable_Generic ) ]
1817pub enum CtorOf {
1918 /// This `DefKind::Ctor` is a synthesized constructor of a tuple or unit struct.
2019 Struct ,
@@ -23,8 +22,7 @@ pub enum CtorOf {
2322}
2423
2524/// What kind of constructor something is.
26- #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug ) ]
27- #[ derive( HashStable_Generic ) ]
25+ #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug , HashStable_Generic ) ]
2826pub enum CtorKind {
2927 /// Constructor function automatically created by a tuple struct/variant.
3028 Fn ,
@@ -33,8 +31,7 @@ pub enum CtorKind {
3331}
3432
3533/// An attribute that is not a macro; e.g., `#[inline]` or `#[rustfmt::skip]`.
36- #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug ) ]
37- #[ derive( HashStable_Generic ) ]
34+ #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug , HashStable_Generic ) ]
3835pub enum NonMacroAttrKind {
3936 /// Single-segment attribute defined by the language (`#[inline]`)
4037 Builtin ( Symbol ) ,
@@ -48,8 +45,7 @@ pub enum NonMacroAttrKind {
4845}
4946
5047/// What kind of definition something is; e.g., `mod` vs `struct`.
51- #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug ) ]
52- #[ derive( HashStable_Generic ) ]
48+ #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug , HashStable_Generic ) ]
5349pub enum DefKind {
5450 // Type namespace
5551 Mod ,
@@ -299,8 +295,7 @@ impl DefKind {
299295/// - the call to `str_to_string` will resolve to [`Res::Def`], with the [`DefId`]
300296/// pointing to the definition of `str_to_string` in the current crate.
301297//
302- #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug ) ]
303- #[ derive( HashStable_Generic ) ]
298+ #[ derive( Clone , Copy , PartialEq , Eq , Encodable , Decodable , Hash , Debug , HashStable_Generic ) ]
304299pub enum Res < Id = hir:: HirId > {
305300 /// Definition having a unique ID (`DefId`), corresponds to something defined in user code.
306301 ///
@@ -591,6 +586,8 @@ impl NonMacroAttrKind {
591586 }
592587 }
593588
589+ // Currently trivial, but exists in case a new kind is added in the future whose name starts
590+ // with a vowel.
594591 pub fn article ( self ) -> & ' static str {
595592 "a"
596593 }
0 commit comments