Auto merge of #5488 - phansch:future-not-send-ret-ty, r=flip1995

Cleanup: future_not_send: use `utils::return_ty` function

changelog: none
This commit is contained in:
bors 2020-04-19 17:50:33 +00:00
commit 6ed2ae8685
1 changed files with 1 additions and 4 deletions

View File

@ -60,10 +60,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FutureNotSend {
if let FnKind::Closure(_) = kind {
return;
}
let def_id = cx.tcx.hir().local_def_id(hir_id);
let fn_sig = cx.tcx.fn_sig(def_id);
let fn_sig = cx.tcx.erase_late_bound_regions(&fn_sig);
let ret_ty = fn_sig.output();
let ret_ty = utils::return_ty(cx, hir_id);
if let Opaque(id, subst) = ret_ty.kind {
let preds = cx.tcx.predicates_of(id).instantiate(cx.tcx, subst);
let mut is_future = false;