aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-04-02 20:01:54 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-04-02 20:01:54 +0100
commitfdbebccd71d38c4dffffe918b036bbfa39355c5f (patch)
tree541c13ce234023bbfc640a38e55e860c029fd52c /crates/ra_syntax/src/ast
parent01a54f094ba7c17a6788ec706f12b07d8d60af4b (diff)
parentb9d2c2c21fe8880fe1ca29b70b03db1d3faac554 (diff)
Merge #1076
1076: Const body inference r=flodiebold a=Lapz This is the second part of #887. I've added type inference on const bodies and introduced the DefWithBody containing Function, Const and Static. I want to add tests but im unsure on how I would go about testing that completions work. Co-authored-by: Lenard Pratt <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index c2e89de15..0376c91c8 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -513,7 +513,11 @@ impl ast::TypeParamsOwner for ConstDef {}
513impl ast::AttrsOwner for ConstDef {} 513impl ast::AttrsOwner for ConstDef {}
514impl ast::DocCommentsOwner for ConstDef {} 514impl ast::DocCommentsOwner for ConstDef {}
515impl ast::TypeAscriptionOwner for ConstDef {} 515impl ast::TypeAscriptionOwner for ConstDef {}
516impl ConstDef {} 516impl ConstDef {
517 pub fn body(&self) -> Option<&Expr> {
518 super::child_opt(self)
519 }
520}
517 521
518// ContinueExpr 522// ContinueExpr
519#[derive(Debug, PartialEq, Eq, Hash)] 523#[derive(Debug, PartialEq, Eq, Hash)]
@@ -3364,7 +3368,11 @@ impl ast::TypeParamsOwner for StaticDef {}
3364impl ast::AttrsOwner for StaticDef {} 3368impl ast::AttrsOwner for StaticDef {}
3365impl ast::DocCommentsOwner for StaticDef {} 3369impl ast::DocCommentsOwner for StaticDef {}
3366impl ast::TypeAscriptionOwner for StaticDef {} 3370impl ast::TypeAscriptionOwner for StaticDef {}
3367impl StaticDef {} 3371impl StaticDef {
3372 pub fn body(&self) -> Option<&Expr> {
3373 super::child_opt(self)
3374 }
3375}
3368 3376
3369// Stmt 3377// Stmt
3370#[derive(Debug, PartialEq, Eq, Hash)] 3378#[derive(Debug, PartialEq, Eq, Hash)]