File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ pub struct TraitDefn {
142
142
pub variable_kinds : Vec < VariableKind > ,
143
143
pub where_clauses : Vec < QuantifiedWhereClause > ,
144
144
pub assoc_ty_defns : Vec < AssocTyDefn > ,
145
+ pub assoc_const_defns : Vec < AssocConstDefn > ,
145
146
pub flags : TraitFlags ,
146
147
pub well_known : Option < WellKnownTrait > ,
147
148
}
@@ -182,6 +183,12 @@ pub struct AssocTyDefn {
182
183
pub where_clauses : Vec < QuantifiedWhereClause > ,
183
184
}
184
185
186
+ #[ derive( Clone , PartialEq , Eq , Debug ) ]
187
+ pub struct AssocConstDefn {
188
+ pub name : Identifier ,
189
+ pub ty : Ty ,
190
+ }
191
+
185
192
#[ derive( Clone , PartialEq , Eq , Debug ) ]
186
193
pub struct OpaqueTyDefn {
187
194
pub ty : Ty ,
Original file line number Diff line number Diff line change @@ -257,12 +257,13 @@ ClosureArgs: Vec<Ty> = {
257
257
258
258
TraitDefn: TraitDefn = {
259
259
<auto:AutoKeyword?> <marker:MarkerKeyword?> <upstream:UpstreamKeyword?> <fundamental:FundamentalKeyword?> <non_enumerable:NonEnumerableKeyword?> <coinductive:CoinductiveKeyword?> <object_safe:ObjectSafeKeyword?> <well_known:WellKnownTrait?> "trait" <n:Id><p:Angle<VariableKind>>
260
- <w:QuantifiedWhereClauses> "{" <a:AssocTyDefn*> "}" => TraitDefn
260
+ <w:QuantifiedWhereClauses> "{" <a:AssocTyDefn*> <ac:AssocConstDefn*> "}" => TraitDefn
261
261
{
262
262
name: n,
263
263
variable_kinds: p,
264
264
where_clauses: w,
265
265
assoc_ty_defns: a,
266
+ assoc_const_defns: ac,
266
267
well_known,
267
268
flags: TraitFlags {
268
269
auto: auto.is_some(),
@@ -289,6 +290,15 @@ AssocTyDefn: AssocTyDefn = {
289
290
}
290
291
};
291
292
293
+ AssocConstDefn: AssocConstDefn = {
294
+ "const" <name:Id> ":" <ty:Ty> ";" => {
295
+ AssocConstDefn {
296
+ name: name,
297
+ ty: ty,
298
+ }
299
+ }
300
+ };
301
+
292
302
OpaqueTyDefn: OpaqueTyDefn = {
293
303
"opaque" "type" <name:Id> <p:Angle<VariableKind>> <b:(":" <Plus<QuantifiedInlineBound>>)?>
294
304
<w:QuantifiedWhereClauses> "=" <ty:Ty> ";" => {
You can’t perform that action at this time.
0 commit comments