diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2022-03-19 20:24:09 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2022-03-19 20:24:09 +0100 |
| commit | 2598575a35266d8ece1f4e4ecef996622eaef42a (patch) | |
| tree | f393bb8f1c594297024adf6108695ccf782ffd60 | |
| parent | 7da5b80f259a777a43ea4e208def4672cb0fb545 (diff) | |
| download | rust-2598575a35266d8ece1f4e4ecef996622eaef42a.tar.gz rust-2598575a35266d8ece1f4e4ecef996622eaef42a.zip | |
fix: Fix closure hints using macro ranges
| -rw-r--r-- | crates/ide/src/inlay_hints.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 13e7a0ac889..565bee88f3f 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -344,12 +344,12 @@ fn closure_ret_hints( return None; } - let closure = sema.descend_node_into_attributes(closure.clone()).pop()?; - let param_list = match closure.body() { Some(ast::Expr::BlockExpr(_)) => closure.param_list()?, _ => return None, }; + + let closure = sema.descend_node_into_attributes(closure.clone()).pop()?; let ty = sema.type_of_expr(&ast::Expr::ClosureExpr(closure))?.adjusted(); let callable = ty.as_callable(sema.db)?; let ty = callable.return_type(); |
