Recurse into let bindings if possible in ref casting lint
This commit is contained in:
parent
97a26138e9
commit
4839cca9aa
3 changed files with 41 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue