Recurse into let bindings if possible in ref casting lint

This commit is contained in:
Urgau 2023-12-12 20:06:28 +01:00
parent 97a26138e9
commit 4839cca9aa
3 changed files with 41 additions and 9 deletions

View file

@ -182,7 +182,12 @@ fn peel_casts<'tcx>(cx: &LateContext<'tcx>, mut e: &'tcx Expr<'tcx>) -> (&'tcx E
}
arg
} else {
break;
let init = cx.expr_or_init(e);
if init.hir_id != e.hir_id {
init
} else {
break;
}
};
}