@@ -13,8 +13,7 @@ use std::array::IntoIter;
13
13
use std:: fmt:: Debug ;
14
14
15
15
/// 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 ) ]
18
17
pub enum CtorOf {
19
18
/// This `DefKind::Ctor` is a synthesized constructor of a tuple or unit struct.
20
19
Struct ,
@@ -23,8 +22,7 @@ pub enum CtorOf {
23
22
}
24
23
25
24
/// 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 ) ]
28
26
pub enum CtorKind {
29
27
/// Constructor function automatically created by a tuple struct/variant.
30
28
Fn ,
@@ -33,8 +31,7 @@ pub enum CtorKind {
33
31
}
34
32
35
33
/// 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 ) ]
38
35
pub enum NonMacroAttrKind {
39
36
/// Single-segment attribute defined by the language (`#[inline]`)
40
37
Builtin ( Symbol ) ,
@@ -48,8 +45,7 @@ pub enum NonMacroAttrKind {
48
45
}
49
46
50
47
/// 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 ) ]
53
49
pub enum DefKind {
54
50
// Type namespace
55
51
Mod ,
@@ -299,8 +295,7 @@ impl DefKind {
299
295
/// - the call to `str_to_string` will resolve to [`Res::Def`], with the [`DefId`]
300
296
/// pointing to the definition of `str_to_string` in the current crate.
301
297
//
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 ) ]
304
299
pub enum Res < Id = hir:: HirId > {
305
300
/// Definition having a unique ID (`DefId`), corresponds to something defined in user code.
306
301
///
@@ -591,6 +586,8 @@ impl NonMacroAttrKind {
591
586
}
592
587
}
593
588
589
+ // Currently trivial, but exists in case a new kind is added in the future whose name starts
590
+ // with a vowel.
594
591
pub fn article ( self ) -> & ' static str {
595
592
"a"
596
593
}
0 commit comments