aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r--crates/ra_hir/src/expr.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index a85422955..2ff4139f9 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -726,13 +726,7 @@ impl ExprCollector {
726 self.alloc_expr(Expr::Array { exprs }, syntax_ptr) 726 self.alloc_expr(Expr::Array { exprs }, syntax_ptr)
727 } 727 }
728 ast::ExprKind::Literal(e) => { 728 ast::ExprKind::Literal(e) => {
729 let child = if let Some(child) = e.literal_expr() { 729 let lit = match e.flavor() {
730 child
731 } else {
732 return self.alloc_expr(Expr::Missing, syntax_ptr);
733 };
734
735 let lit = match child.flavor() {
736 LiteralFlavor::IntNumber { suffix } => { 730 LiteralFlavor::IntNumber { suffix } => {
737 let known_name = suffix 731 let known_name = suffix
738 .and_then(|it| IntTy::from_suffix(&it).map(UncertainIntTy::Known)); 732 .and_then(|it| IntTy::from_suffix(&it).map(UncertainIntTy::Known));
@@ -874,9 +868,7 @@ impl ExprCollector {
874 fn collect_fn_body(&mut self, node: &ast::FnDef) { 868 fn collect_fn_body(&mut self, node: &ast::FnDef) {
875 if let Some(param_list) = node.param_list() { 869 if let Some(param_list) = node.param_list() {
876 if let Some(self_param) = param_list.self_param() { 870 if let Some(self_param) = param_list.self_param() {
877 let self_param = SyntaxNodePtr::new( 871 let self_param = SyntaxNodePtr::new(self_param.syntax());
878 self_param.self_kw().expect("self param without self keyword").syntax(),
879 );
880 let param_pat = self.alloc_pat( 872 let param_pat = self.alloc_pat(
881 Pat::Bind { 873 Pat::Bind {
882 name: Name::self_param(), 874 name: Name::self_param(),