From 502a66de3dd1cd899a8d287b82d4e21cb210dd6b Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Sun, 19 Apr 2020 14:00:03 +0200 Subject: [PATCH] Cleanup: future_not_send: use `return_ty` method --- clippy_lints/src/future_not_send.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/clippy_lints/src/future_not_send.rs b/clippy_lints/src/future_not_send.rs index 57f47bc9bc9..704a95ec0a0 100644 --- a/clippy_lints/src/future_not_send.rs +++ b/clippy_lints/src/future_not_send.rs @@ -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;