]> git.lizzy.rs Git - rust.git/commitdiff
Cleanup: future_not_send: use `return_ty` method
authorPhilipp Hansch <dev@phansch.net>
Sun, 19 Apr 2020 12:00:03 +0000 (14:00 +0200)
committerPhilipp Hansch <dev@phansch.net>
Sun, 19 Apr 2020 12:00:03 +0000 (14:00 +0200)
clippy_lints/src/future_not_send.rs

index 57f47bc9bc932f50deb27b13a1ffc07ae73a0279..704a95ec0a0909a50efc12f84fbec8f7d1ec54de 100644 (file)
@@ -60,10 +60,7 @@ fn check_fn(
         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;