mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
Merge #11765
11765: fix: Fix closure hints using macro ranges r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
a82caff588
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue