diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index df560155c6c..4f23cb5c854 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -372,7 +372,7 @@ fn collect_expr(&mut self, expr: ast::Expr) -> ExprId { } ast::Expr::RefExpr(e) => { let expr = self.collect_expr_opt(e.expr()); - let mutability = Mutability::from_mutable(e.is_mut()); + let mutability = Mutability::from_mutable(e.mut_kw_token().is_some()); self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) } ast::Expr::PrefixExpr(e) => { diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index 003ee00b3e5..5c5f196224b 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs @@ -49,10 +49,6 @@ fn blocks(&self) -> AstChildren { } impl ast::RefExpr { - pub fn is_mut(&self) -> bool { - self.syntax().children_with_tokens().any(|n| n.kind() == T![mut]) - } - pub fn raw_token(&self) -> Option { None // FIXME: implement &raw }