From 88e22e9d70ac3a35989ad1d45386f86697877c4c Mon Sep 17 00:00:00 2001 From: Lenard Pratt Date: Sat, 30 Mar 2019 11:17:31 +0000 Subject: Added const bodies and static body to the ast and added inference the inference test reduce code duplication --- crates/ra_syntax/src/ast/generated.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (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 31b4e73fb..84f39cda1 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -629,7 +629,11 @@ impl ast::TypeParamsOwner for ConstDef {} impl ast::AttrsOwner for ConstDef {} impl ast::DocCommentsOwner for ConstDef {} impl ast::TypeAscriptionOwner for ConstDef {} -impl ConstDef {} +impl ConstDef { + pub fn body(&self) -> Option<&Expr> { + super::child_opt(self) + } +} // ContinueExpr #[derive(Debug, PartialEq, Eq, Hash)] @@ -657,7 +661,6 @@ impl ToOwned for ContinueExpr { } - impl ContinueExpr {} // DynTraitType @@ -3808,7 +3811,11 @@ impl ast::TypeParamsOwner for StaticDef {} impl ast::AttrsOwner for StaticDef {} impl ast::DocCommentsOwner for StaticDef {} impl ast::TypeAscriptionOwner for StaticDef {} -impl StaticDef {} +impl StaticDef { + pub fn body(&self) -> Option<&Expr> { + super::child_opt(self) + } +} // Stmt #[derive(Debug, PartialEq, Eq, Hash)] -- cgit v1.2.3