Skip to content

Commit 81359af

Browse files
committed
Simplify trait gramamr
1 parent 9818108 commit 81359af

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

crates/ra_syntax/src/ast/generated/nodes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ impl Impl {
267267
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
268268
pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
269269
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
270-
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
271270
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
272271
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
273272
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }

xtask/src/codegen/gen_syntax.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ fn lower_rule(acc: &mut Vec<Field>, grammar: &Grammar, label: Option<&String>, r
591591
| "index"
592592
| "base"
593593
| "value"
594+
| "target_type"
595+
| "target_trait"
594596
);
595597
if manually_implemented {
596598
return;

xtask/src/codegen/rust.ungram

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,11 @@ AssocItem =
194194
| TypeAlias
195195

196196
Impl =
197-
Attr* Visibility?
198-
'default'? 'unsafe'? 'impl' 'const'? GenericParamList? (
199-
Type
200-
| '!'? Type 'for' Type
201-
) WhereClause?
202-
AssocItemList
197+
Attr* Visibility?
198+
'default'? 'unsafe'? 'impl' 'const'? GenericParamList?
199+
('!'? target_trait:Type 'for')? target_type:Type
200+
WhereClause?
201+
AssocItemList
203202

204203
ExternBlock =
205204
Attr* Abi ExternItemList

0 commit comments

Comments
 (0)