diff options
author | Ville Penttinen <[email protected]> | 2019-02-27 12:00:08 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-02-27 12:08:09 +0000 |
commit | d3ce69aee3297e683691ec0123f5a2584a8075a0 (patch) | |
tree | 717f16fc401332de83230f8ae69c4320c2c714cd /crates/ra_syntax/src | |
parent | 52054e1140cc2af19825ebef2aea06c48cf79955 (diff) |
Remove `TypeRef` from item opts which implement TypeAscriptionOwner
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 30 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 17 |
2 files changed, 14 insertions, 33 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 6db2f74ef..7572225b8 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -629,11 +629,7 @@ impl ast::TypeParamsOwner for ConstDef {} | |||
629 | impl ast::AttrsOwner for ConstDef {} | 629 | impl ast::AttrsOwner for ConstDef {} |
630 | impl ast::DocCommentsOwner for ConstDef {} | 630 | impl ast::DocCommentsOwner for ConstDef {} |
631 | impl ast::TypeAscriptionOwner for ConstDef {} | 631 | impl ast::TypeAscriptionOwner for ConstDef {} |
632 | impl ConstDef { | 632 | impl ConstDef {} |
633 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
634 | super::child_opt(self) | ||
635 | } | ||
636 | } | ||
637 | 633 | ||
638 | // ContinueExpr | 634 | // ContinueExpr |
639 | #[derive(Debug, PartialEq, Eq, Hash)] | 635 | #[derive(Debug, PartialEq, Eq, Hash)] |
@@ -1774,10 +1770,6 @@ impl LetStmt { | |||
1774 | super::child_opt(self) | 1770 | super::child_opt(self) |
1775 | } | 1771 | } |
1776 | 1772 | ||
1777 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
1778 | super::child_opt(self) | ||
1779 | } | ||
1780 | |||
1781 | pub fn initializer(&self) -> Option<&Expr> { | 1773 | pub fn initializer(&self) -> Option<&Expr> { |
1782 | super::child_opt(self) | 1774 | super::child_opt(self) |
1783 | } | 1775 | } |
@@ -2595,11 +2587,7 @@ impl ast::NameOwner for NamedFieldDef {} | |||
2595 | impl ast::AttrsOwner for NamedFieldDef {} | 2587 | impl ast::AttrsOwner for NamedFieldDef {} |
2596 | impl ast::DocCommentsOwner for NamedFieldDef {} | 2588 | impl ast::DocCommentsOwner for NamedFieldDef {} |
2597 | impl ast::TypeAscriptionOwner for NamedFieldDef {} | 2589 | impl ast::TypeAscriptionOwner for NamedFieldDef {} |
2598 | impl NamedFieldDef { | 2590 | impl NamedFieldDef {} |
2599 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
2600 | super::child_opt(self) | ||
2601 | } | ||
2602 | } | ||
2603 | 2591 | ||
2604 | // NamedFieldDefList | 2592 | // NamedFieldDefList |
2605 | #[derive(Debug, PartialEq, Eq, Hash)] | 2593 | #[derive(Debug, PartialEq, Eq, Hash)] |
@@ -2782,10 +2770,6 @@ impl Param { | |||
2782 | pub fn pat(&self) -> Option<&Pat> { | 2770 | pub fn pat(&self) -> Option<&Pat> { |
2783 | super::child_opt(self) | 2771 | super::child_opt(self) |
2784 | } | 2772 | } |
2785 | |||
2786 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
2787 | super::child_opt(self) | ||
2788 | } | ||
2789 | } | 2773 | } |
2790 | 2774 | ||
2791 | // ParamList | 2775 | // ParamList |
@@ -3691,10 +3675,6 @@ impl ToOwned for SelfParam { | |||
3691 | 3675 | ||
3692 | impl ast::TypeAscriptionOwner for SelfParam {} | 3676 | impl ast::TypeAscriptionOwner for SelfParam {} |
3693 | impl SelfParam { | 3677 | impl SelfParam { |
3694 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
3695 | super::child_opt(self) | ||
3696 | } | ||
3697 | |||
3698 | pub fn self_kw(&self) -> Option<&SelfKw> { | 3678 | pub fn self_kw(&self) -> Option<&SelfKw> { |
3699 | super::child_opt(self) | 3679 | super::child_opt(self) |
3700 | } | 3680 | } |
@@ -3826,11 +3806,7 @@ impl ast::TypeParamsOwner for StaticDef {} | |||
3826 | impl ast::AttrsOwner for StaticDef {} | 3806 | impl ast::AttrsOwner for StaticDef {} |
3827 | impl ast::DocCommentsOwner for StaticDef {} | 3807 | impl ast::DocCommentsOwner for StaticDef {} |
3828 | impl ast::TypeAscriptionOwner for StaticDef {} | 3808 | impl ast::TypeAscriptionOwner for StaticDef {} |
3829 | impl StaticDef { | 3809 | impl StaticDef {} |
3830 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
3831 | super::child_opt(self) | ||
3832 | } | ||
3833 | } | ||
3834 | 3810 | ||
3835 | // Stmt | 3811 | // Stmt |
3836 | #[derive(Debug, PartialEq, Eq, Hash)] | 3812 | #[derive(Debug, PartialEq, Eq, Hash)] |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index a3bfc74a7..b7a2d1c01 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -271,7 +271,15 @@ Grammar( | |||
271 | ] | 271 | ] |
272 | ), | 272 | ), |
273 | "NamedFieldDefList": (collections: [["fields", "NamedFieldDef"]]), | 273 | "NamedFieldDefList": (collections: [["fields", "NamedFieldDef"]]), |
274 | "NamedFieldDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner", "TypeAscriptionOwner"], options: ["TypeRef"] ), | 274 | "NamedFieldDef": ( |
275 | traits: [ | ||
276 | "VisibilityOwner", | ||
277 | "NameOwner", | ||
278 | "AttrsOwner", | ||
279 | "DocCommentsOwner", | ||
280 | "TypeAscriptionOwner" | ||
281 | ] | ||
282 | ), | ||
275 | "PosFieldDefList": (collections: [["fields", "PosFieldDef"]]), | 283 | "PosFieldDefList": (collections: [["fields", "PosFieldDef"]]), |
276 | "PosFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]), | 284 | "PosFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]), |
277 | "EnumDef": ( traits: [ | 285 | "EnumDef": ( traits: [ |
@@ -301,7 +309,6 @@ Grammar( | |||
301 | "DocCommentsOwner", | 309 | "DocCommentsOwner", |
302 | "TypeAscriptionOwner", | 310 | "TypeAscriptionOwner", |
303 | ], | 311 | ], |
304 | options: ["TypeRef"] | ||
305 | ), | 312 | ), |
306 | "StaticDef": ( | 313 | "StaticDef": ( |
307 | traits: [ | 314 | traits: [ |
@@ -312,7 +319,6 @@ Grammar( | |||
312 | "DocCommentsOwner", | 319 | "DocCommentsOwner", |
313 | "TypeAscriptionOwner", | 320 | "TypeAscriptionOwner", |
314 | ], | 321 | ], |
315 | options: ["TypeRef"] | ||
316 | ), | 322 | ), |
317 | "TypeAliasDef": ( | 323 | "TypeAliasDef": ( |
318 | traits: [ | 324 | traits: [ |
@@ -574,7 +580,6 @@ Grammar( | |||
574 | "LetStmt": ( | 580 | "LetStmt": ( |
575 | options: [ | 581 | options: [ |
576 | ["pat", "Pat"], | 582 | ["pat", "Pat"], |
577 | ["type_ref", "TypeRef"], | ||
578 | ["initializer", "Expr"], | 583 | ["initializer", "Expr"], |
579 | ], | 584 | ], |
580 | traits: [ | 585 | traits: [ |
@@ -603,14 +608,14 @@ Grammar( | |||
603 | ] | 608 | ] |
604 | ), | 609 | ), |
605 | "SelfParam": ( | 610 | "SelfParam": ( |
606 | options: ["TypeRef", "SelfKw"], | 611 | options: ["SelfKw"], |
607 | traits: [ | 612 | traits: [ |
608 | "TypeAscriptionOwner", | 613 | "TypeAscriptionOwner", |
609 | ] | 614 | ] |
610 | ), | 615 | ), |
611 | "SelfKw": (), | 616 | "SelfKw": (), |
612 | "Param": ( | 617 | "Param": ( |
613 | options: [ "Pat", "TypeRef" ], | 618 | options: [ "Pat" ], |
614 | traits: [ | 619 | traits: [ |
615 | "TypeAscriptionOwner", | 620 | "TypeAscriptionOwner", |
616 | ] | 621 | ] |