aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-30 17:29:24 +0100
committerGitHub <[email protected]>2020-07-30 17:29:24 +0100
commit0f5805541be90a2789b0bc34c5d829042ac3b0ad (patch)
tree27effc491f45f7bd907cb0b24a5b0d907298d169 /xtask
parentc8e2d67dd4462904f2803d64c651f4630ee595f4 (diff)
parentc5798c4d75aa807aec47208a49101bdec3affcca (diff)
Merge #5606
5606: Finalize impl Grammar r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/ast_src.rs4
-rw-r--r--xtask/src/codegen/rust.ungram22
2 files changed, 16 insertions, 10 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index 56e3f4b0a..c7087a14e 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -103,8 +103,8 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
103 "USE", 103 "USE",
104 "STATIC", 104 "STATIC",
105 "CONST", 105 "CONST",
106 "TRAIT_DEF", 106 "TRAIT",
107 "IMPL_DEF", 107 "IMPL",
108 "TYPE_ALIAS", 108 "TYPE_ALIAS",
109 "MACRO_CALL", 109 "MACRO_CALL",
110 "TOKEN_TREE", 110 "TOKEN_TREE",
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index ef7c3e50e..cda0e8fbb 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -9,12 +9,12 @@ Item =
9| ExternBlock 9| ExternBlock
10| ExternCrate 10| ExternCrate
11| Fn 11| Fn
12| ImplDef 12| Impl
13| MacroCall 13| MacroCall
14| Module 14| Module
15| Static 15| Static
16| Struct 16| Struct
17| TraitDef 17| Trait
18| TypeAlias 18| TypeAlias
19| Union 19| Union
20| Use 20| Use
@@ -66,8 +66,11 @@ SelfParam =
66 ) 66 )
67 67
68Param = 68Param =
69 Attr* Pat (':' ascribed_type:TypeRef) 69 Attr* (
70| '...' 70 Pat (':' ascribed_type:TypeRef)
71 | ascribed_type:TypeRef
72 | '...'
73 )
71 74
72RetType = 75RetType =
73 '->' TypeRef 76 '->' TypeRef
@@ -120,7 +123,7 @@ Static =
120 Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef 123 Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef
121 '=' body:Expr ';' 124 '=' body:Expr ';'
122 125
123TraitDef = 126Trait =
124 Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name GenericParamList 127 Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name GenericParamList
125 (':' TypeBoundList?)? WhereClause 128 (':' TypeBoundList?)? WhereClause
126 AssocItemList 129 AssocItemList
@@ -128,9 +131,12 @@ TraitDef =
128AssocItemList = 131AssocItemList =
129 '{' AssocItem* '}' 132 '{' AssocItem* '}'
130 133
131ImplDef = 134Impl =
132 Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' GenericParamList? '!'? 'for' 135 Attr* Visibility?
133 WhereClause? 136 'default'? 'unsafe'? 'impl' 'const'? GenericParamList? (
137 TypeRef
138 | '!'? TypeRef 'for' TypeRef
139 ) WhereClause?
134 AssocItemList 140 AssocItemList
135 141
136ParenType = 142ParenType =