about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-19 17:50:33 +0000
committerbors <bors@rust-lang.org>2020-04-19 17:50:33 +0000
commit6ed2ae86851e1932e7ceddb24a6e0782e27498a9 (patch)
treecfb7e06bb4f9f64784ccd4203367e576e9e43f2e
parent9273eab036e87ac957c685b12620f179302691a7 (diff)
parent502a66de3dd1cd899a8d287b82d4e21cb210dd6b (diff)
downloadrust-6ed2ae86851e1932e7ceddb24a6e0782e27498a9.tar.gz
rust-6ed2ae86851e1932e7ceddb24a6e0782e27498a9.zip
Auto merge of #5488 - phansch:future-not-send-ret-ty, r=flip1995
Cleanup: future_not_send: use `utils::return_ty` function

changelog: none
-rw-r--r--clippy_lints/src/future_not_send.rs5
1 files changed, 1 insertions, 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;