diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 16:52:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-30 16:52:59 +0000 |
| commit | bc8610e2b58fe101ddc34d0ce389cfa829060c62 (patch) | |
| tree | fac9cf9a1ac4e4e28570261f2e755aa4f92f904d /xtask/src/codegen | |
| parent | af8132e610d1e649e67ab797e372d1efcf106c48 (diff) | |
| parent | 3dce34aaf83c67836c94a526cb90eba8f36e3985 (diff) | |
| download | rust-bc8610e2b58fe101ddc34d0ce389cfa829060c62.tar.gz rust-bc8610e2b58fe101ddc34d0ce389cfa829060c62.zip | |
Merge #5608
5608: Introduce GenericParam r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
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 cdd3adf4577..4025f7f96cd 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -154,6 +154,25 @@ ExternItemList = ExternItem = Fn | Static | MacroCall +GenericParamList = + '<' (GenericParam (',' GenericParam)* ','?)? '>' + +GenericParam = + LifetimeParam +| TypeParam +| ConstParam + +TypeParam = + Attr* Name (':' TypeBoundList?)? + ('=' default_type:TypeRef)? + +ConstParam = + Attr* 'const' Name ':' ascribed_type:TypeRef + ('=' default_val:Expr)? + +LifetimeParam = + Attr* 'lifetime' + ParenType = '(' TypeRef ')' @@ -400,24 +419,6 @@ MacroStmts = Attr = '#' '!'? '[' Path ('=' input:AttrInput)? ']' -GenericParamList = - '<' - TypeParam* - LifetimeParam* - ConstParam* - '>' - -TypeParam = - Attr* Name (':' TypeBoundList?)? - ('=' default_type:TypeRef)? - -ConstParam = - Attr* 'const' Name ':' ascribed_type:TypeRef - ('=' default_val:Expr)? - -LifetimeParam = - Attr* 'lifetime' - TypeBound = 'lifetime' | 'const'? TypeRef |
