File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,17 @@ impl GenericArgs {
167
167
pub enum GenericArg {
168
168
Lifetime ( Lifetime ) ,
169
169
Type ( P < Ty > ) ,
170
+ Const ( AnonConst ) ,
171
+ }
172
+
173
+ impl GenericArg {
174
+ pub fn span ( & self ) -> Span {
175
+ match self {
176
+ GenericArg :: Lifetime ( lt) => lt. ident . span ,
177
+ GenericArg :: Type ( ty) => ty. span ,
178
+ GenericArg :: Const ( ct) => ct. value . span ,
179
+ }
180
+ }
170
181
}
171
182
172
183
/// A path like `Foo<'a, T>`
@@ -300,9 +311,8 @@ pub type GenericBounds = Vec<GenericBound>;
300
311
pub enum GenericParamKind {
301
312
/// A lifetime definition (e.g., `'a: 'b + 'c + 'd`).
302
313
Lifetime ,
303
- Type {
304
- default : Option < P < Ty > > ,
305
- } ,
314
+ Type { default : Option < P < Ty > > } ,
315
+ Const { ty : P < Ty > } ,
306
316
}
307
317
308
318
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
You can’t perform that action at this time.
0 commit comments