diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 17:52:59 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 17:52:59 +0100 |
commit | bc8610e2b58fe101ddc34d0ce389cfa829060c62 (patch) | |
tree | fac9cf9a1ac4e4e28570261f2e755aa4f92f904d /xtask/src/codegen | |
parent | af8132e610d1e649e67ab797e372d1efcf106c48 (diff) | |
parent | 3dce34aaf83c67836c94a526cb90eba8f36e3985 (diff) |
Merge #5608
5608: Introduce GenericParam r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r-- | xtask/src/codegen/rust.ungram | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index cdd3adf45..4025f7f96 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram | |||
@@ -154,6 +154,25 @@ ExternItemList = | |||
154 | ExternItem = | 154 | ExternItem = |
155 | Fn | Static | MacroCall | 155 | Fn | Static | MacroCall |
156 | 156 | ||
157 | GenericParamList = | ||
158 | '<' (GenericParam (',' GenericParam)* ','?)? '>' | ||
159 | |||
160 | GenericParam = | ||
161 | LifetimeParam | ||
162 | | TypeParam | ||
163 | | ConstParam | ||
164 | |||
165 | TypeParam = | ||
166 | Attr* Name (':' TypeBoundList?)? | ||
167 | ('=' default_type:TypeRef)? | ||
168 | |||
169 | ConstParam = | ||
170 | Attr* 'const' Name ':' ascribed_type:TypeRef | ||
171 | ('=' default_val:Expr)? | ||
172 | |||
173 | LifetimeParam = | ||
174 | Attr* 'lifetime' | ||
175 | |||
157 | ParenType = | 176 | ParenType = |
158 | '(' TypeRef ')' | 177 | '(' TypeRef ')' |
159 | 178 | ||
@@ -400,24 +419,6 @@ MacroStmts = | |||
400 | Attr = | 419 | Attr = |
401 | '#' '!'? '[' Path ('=' input:AttrInput)? ']' | 420 | '#' '!'? '[' Path ('=' input:AttrInput)? ']' |
402 | 421 | ||
403 | GenericParamList = | ||
404 | '<' | ||
405 | TypeParam* | ||
406 | LifetimeParam* | ||
407 | ConstParam* | ||
408 | '>' | ||
409 | |||
410 | TypeParam = | ||
411 | Attr* Name (':' TypeBoundList?)? | ||
412 | ('=' default_type:TypeRef)? | ||
413 | |||
414 | ConstParam = | ||
415 | Attr* 'const' Name ':' ascribed_type:TypeRef | ||
416 | ('=' default_val:Expr)? | ||
417 | |||
418 | LifetimeParam = | ||
419 | Attr* 'lifetime' | ||
420 | |||
421 | TypeBound = | 422 | TypeBound = |
422 | 'lifetime' | 'const'? TypeRef | 423 | 'lifetime' | 'const'? TypeRef |
423 | 424 | ||