@@ -52,6 +52,13 @@ pub enum ParamName {
52
52
/// Some user-given name like `T` or `'x`.
53
53
Plain ( Ident ) ,
54
54
55
+ /// Indicates an illegal name was given and an error has been
56
+ /// reported (so we should squelch other derived errors).
57
+ ///
58
+ /// Occurs when, e.g., `'_` is used in the wrong place, or a
59
+ /// lifetime name is duplicated.
60
+ Error ( Ident ) ,
61
+
55
62
/// Synthetic name generated when user elided a lifetime in an impl header.
56
63
///
57
64
/// E.g., the lifetimes in cases like these:
@@ -67,18 +74,13 @@ pub enum ParamName {
67
74
/// where `'f` is something like `Fresh(0)`. The indices are
68
75
/// unique per impl, but not necessarily continuous.
69
76
Fresh ,
70
-
71
- /// Indicates an illegal name was given and an error has been
72
- /// reported (so we should squelch other derived errors). Occurs
73
- /// when, e.g., `'_` is used in the wrong place.
74
- Error ,
75
77
}
76
78
77
79
impl ParamName {
78
80
pub fn ident ( & self ) -> Ident {
79
81
match * self {
80
- ParamName :: Plain ( ident) => ident,
81
- ParamName :: Fresh | ParamName :: Error => Ident :: with_dummy_span ( kw:: UnderscoreLifetime ) ,
82
+ ParamName :: Plain ( ident) | ParamName :: Error ( ident ) => ident,
83
+ ParamName :: Fresh => Ident :: with_dummy_span ( kw:: UnderscoreLifetime ) ,
82
84
}
83
85
}
84
86
}
0 commit comments