Cleanup: future_not_send: use return_ty method

This commit is contained in:
Philipp Hansch 2020-04-19 14:00:03 +02:00
parent 1c0e4e5b97
commit 502a66de3d
No known key found for this signature in database
GPG Key ID: 2B4399C4BF4DCBDE

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;