From d3ce69aee3297e683691ec0123f5a2584a8075a0 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Wed, 27 Feb 2019 14:00:08 +0200 Subject: Remove `TypeRef` from item opts which implement TypeAscriptionOwner --- crates/ra_syntax/src/ast/generated.rs | 30 +++--------------------------- crates/ra_syntax/src/grammar.ron | 17 +++++++++++------ 2 files changed, 14 insertions(+), 33 deletions(-) (limited to 'crates/ra_syntax') 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 {} impl ast::AttrsOwner for ConstDef {} impl ast::DocCommentsOwner for ConstDef {} impl ast::TypeAscriptionOwner for ConstDef {} -impl ConstDef { - pub fn type_ref(&self) -> Option<&TypeRef> { - super::child_opt(self) - } -} +impl ConstDef {} // ContinueExpr #[derive(Debug, PartialEq, Eq, Hash)] @@ -1774,10 +1770,6 @@ impl LetStmt { super::child_opt(self) } - pub fn type_ref(&self) -> Option<&TypeRef> { - super::child_opt(self) - } - pub fn initializer(&self) -> Option<&Expr> { super::child_opt(self) } @@ -2595,11 +2587,7 @@ impl ast::NameOwner for NamedFieldDef {} impl ast::AttrsOwner for NamedFieldDef {} impl ast::DocCommentsOwner for NamedFieldDef {} impl ast::TypeAscriptionOwner for NamedFieldDef {} -impl NamedFieldDef { - pub fn type_ref(&self) -> Option<&TypeRef> { - super::child_opt(self) - } -} +impl NamedFieldDef {} // NamedFieldDefList #[derive(Debug, PartialEq, Eq, Hash)] @@ -2782,10 +2770,6 @@ impl Param { pub fn pat(&self) -> Option<&Pat> { super::child_opt(self) } - - pub fn type_ref(&self) -> Option<&TypeRef> { - super::child_opt(self) - } } // ParamList @@ -3691,10 +3675,6 @@ impl ToOwned for SelfParam { impl ast::TypeAscriptionOwner for SelfParam {} impl SelfParam { - pub fn type_ref(&self) -> Option<&TypeRef> { - super::child_opt(self) - } - pub fn self_kw(&self) -> Option<&SelfKw> { super::child_opt(self) } @@ -3826,11 +3806,7 @@ impl ast::TypeParamsOwner for StaticDef {} impl ast::AttrsOwner for StaticDef {} impl ast::DocCommentsOwner for StaticDef {} impl ast::TypeAscriptionOwner for StaticDef {} -impl StaticDef { - pub fn type_ref(&self) -> Option<&TypeRef> { - super::child_opt(self) - } -} +impl StaticDef {} // Stmt #[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( ] ), "NamedFieldDefList": (collections: [["fields", "NamedFieldDef"]]), - "NamedFieldDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner", "TypeAscriptionOwner"], options: ["TypeRef"] ), + "NamedFieldDef": ( + traits: [ + "VisibilityOwner", + "NameOwner", + "AttrsOwner", + "DocCommentsOwner", + "TypeAscriptionOwner" + ] + ), "PosFieldDefList": (collections: [["fields", "PosFieldDef"]]), "PosFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]), "EnumDef": ( traits: [ @@ -301,7 +309,6 @@ Grammar( "DocCommentsOwner", "TypeAscriptionOwner", ], - options: ["TypeRef"] ), "StaticDef": ( traits: [ @@ -312,7 +319,6 @@ Grammar( "DocCommentsOwner", "TypeAscriptionOwner", ], - options: ["TypeRef"] ), "TypeAliasDef": ( traits: [ @@ -574,7 +580,6 @@ Grammar( "LetStmt": ( options: [ ["pat", "Pat"], - ["type_ref", "TypeRef"], ["initializer", "Expr"], ], traits: [ @@ -603,14 +608,14 @@ Grammar( ] ), "SelfParam": ( - options: ["TypeRef", "SelfKw"], + options: ["SelfKw"], traits: [ "TypeAscriptionOwner", ] ), "SelfKw": (), "Param": ( - options: [ "Pat", "TypeRef" ], + options: [ "Pat" ], traits: [ "TypeAscriptionOwner", ] -- cgit v1.2.3