From 6eb070d6613644b6698a5ce6454d006662c84d8a Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Tue, 26 Feb 2019 11:35:57 +0200 Subject: Add new trait TypeAscriptionOwner This trait should be implemented for nodes which have an ascribed type, e.g. thing : Type. Such as let, const, static, param, named struct fields. --- crates/ra_syntax/src/ast/generated.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 4e2705d09..6db2f74ef 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -628,6 +628,7 @@ impl ast::NameOwner for ConstDef {} 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) @@ -1767,6 +1768,7 @@ impl ToOwned for LetStmt { } +impl ast::TypeAscriptionOwner for LetStmt {} impl LetStmt { pub fn pat(&self) -> Option<&Pat> { super::child_opt(self) @@ -2592,6 +2594,7 @@ impl ast::VisibilityOwner for NamedFieldDef {} 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) @@ -2774,6 +2777,7 @@ impl ToOwned for Param { } +impl ast::TypeAscriptionOwner for Param {} impl Param { pub fn pat(&self) -> Option<&Pat> { super::child_opt(self) @@ -3685,6 +3689,7 @@ impl ToOwned for SelfParam { } +impl ast::TypeAscriptionOwner for SelfParam {} impl SelfParam { pub fn type_ref(&self) -> Option<&TypeRef> { super::child_opt(self) @@ -3820,6 +3825,7 @@ impl ast::NameOwner for StaticDef {} 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) -- cgit v1.2.3