Enable reborrow hints in attribute calls

This commit is contained in:
Lukas Wirth 2022-05-14 15:00:14 +02:00
parent 6b696fced8
commit 7cbde1b3a5

View File

@ -388,9 +388,9 @@ fn reborrow_hints(
return None;
}
// let descended = sema.descend_node_into_attributes(expr.clone()).pop();
// let desc_expr = descended.as_ref().unwrap_or(expr);
let mutability = sema.is_implicit_reborrow(expr)?;
let descended = sema.descend_node_into_attributes(expr.clone()).pop();
let desc_expr = descended.as_ref().unwrap_or(expr);
let mutability = sema.is_implicit_reborrow(desc_expr)?;
let label = match mutability {
hir::Mutability::Shared if config.reborrow_hints != ReborrowHints::MutableOnly => "&*",
hir::Mutability::Mut => "&mut *",