Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/expr_store/lower.rs')
-rw-r--r--crates/hir-def/src/expr_store/lower.rs26
1 files changed, 8 insertions, 18 deletions
diff --git a/crates/hir-def/src/expr_store/lower.rs b/crates/hir-def/src/expr_store/lower.rs
index f5cf1180eb..df4fc6e531 100644
--- a/crates/hir-def/src/expr_store/lower.rs
+++ b/crates/hir-def/src/expr_store/lower.rs
@@ -26,8 +26,8 @@ use stdx::never;
use syntax::{
AstNode, AstPtr, SyntaxNodePtr,
ast::{
- self, ArrayExprKind, AstChildren, BlockExpr, ForBinder, HasArgList, HasAttrs,
- HasGenericArgs, HasGenericParams, HasLoopBody, HasName, HasTypeBounds, IsString, RangeItem,
+ self, ArrayExprKind, AstChildren, BlockExpr, ForBinder, HasArgList, HasGenericArgs,
+ HasGenericParams, HasLoopBody, HasName, HasTypeBounds, IsString, RangeItem,
SlicePatComponents,
},
};
@@ -1460,23 +1460,13 @@ impl<'db> ExprCollector<'db> {
ast::Expr::WhileExpr(e) => self.collect_while_loop(syntax_ptr, e),
ast::Expr::ForExpr(e) => self.collect_for_loop(syntax_ptr, e),
ast::Expr::CallExpr(e) => {
- // FIXME(MINIMUM_SUPPORTED_TOOLCHAIN_VERSION): Remove this once we drop support for <1.86, https://github.com/rust-lang/rust/commit/ac9cb908ac4301dfc25e7a2edee574320022ae2c
- let is_rustc_box = {
- let attrs = e.attrs();
- attrs.filter_map(|it| it.as_simple_atom()).any(|it| it == "rustc_box")
- };
- if is_rustc_box {
- let expr = self.collect_expr_opt(e.arg_list().and_then(|it| it.args().next()));
- self.alloc_expr(Expr::Box { expr }, syntax_ptr)
+ let callee = self.collect_expr_opt(e.expr());
+ let args = if let Some(arg_list) = e.arg_list() {
+ arg_list.args().filter_map(|e| self.maybe_collect_expr(e)).collect()
} else {
- let callee = self.collect_expr_opt(e.expr());
- let args = if let Some(arg_list) = e.arg_list() {
- arg_list.args().filter_map(|e| self.maybe_collect_expr(e)).collect()
- } else {
- Box::default()
- };
- self.alloc_expr(Expr::Call { callee, args }, syntax_ptr)
- }
+ Box::default()
+ };
+ self.alloc_expr(Expr::Call { callee, args }, syntax_ptr)
}
ast::Expr::MethodCallExpr(e) => {
let receiver = self.collect_expr_opt(e.receiver());