Unnamed repository; edit this file 'description' to name the repository.
Merge #11765
11765: fix: Fix closure hints using macro ranges r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
bors[bot] 2022-03-20
parent 7315d97 · parent 2598575 · commit a82caff
-rw-r--r--crates/ide/src/inlay_hints.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs
index 13e7a0ac88..565bee88f3 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();