aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorVille Penttinen <[email protected]>2019-02-27 12:00:08 +0000
committerVille Penttinen <[email protected]>2019-02-27 12:08:09 +0000
commitd3ce69aee3297e683691ec0123f5a2584a8075a0 (patch)
tree717f16fc401332de83230f8ae69c4320c2c714cd /crates/ra_syntax
parent52054e1140cc2af19825ebef2aea06c48cf79955 (diff)
Remove `TypeRef` from item opts which implement TypeAscriptionOwner
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs30
-rw-r--r--crates/ra_syntax/src/grammar.ron17
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 {}
629impl ast::AttrsOwner for ConstDef {} 629impl ast::AttrsOwner for ConstDef {}
630impl ast::DocCommentsOwner for ConstDef {} 630impl ast::DocCommentsOwner for ConstDef {}
631impl ast::TypeAscriptionOwner for ConstDef {} 631impl ast::TypeAscriptionOwner for ConstDef {}
632impl ConstDef { 632impl 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 {}
2595impl ast::AttrsOwner for NamedFieldDef {} 2587impl ast::AttrsOwner for NamedFieldDef {}
2596impl ast::DocCommentsOwner for NamedFieldDef {} 2588impl ast::DocCommentsOwner for NamedFieldDef {}
2597impl ast::TypeAscriptionOwner for NamedFieldDef {} 2589impl ast::TypeAscriptionOwner for NamedFieldDef {}
2598impl NamedFieldDef { 2590impl 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
3692impl ast::TypeAscriptionOwner for SelfParam {} 3676impl ast::TypeAscriptionOwner for SelfParam {}
3693impl SelfParam { 3677impl 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 {}
3826impl ast::AttrsOwner for StaticDef {} 3806impl ast::AttrsOwner for StaticDef {}
3827impl ast::DocCommentsOwner for StaticDef {} 3807impl ast::DocCommentsOwner for StaticDef {}
3828impl ast::TypeAscriptionOwner for StaticDef {} 3808impl ast::TypeAscriptionOwner for StaticDef {}
3829impl StaticDef { 3809impl 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 ]