Skip to content

Commit 5810f1f

Browse files
committed
remove some trait solver helpers
they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
1 parent 60fe49c commit 5810f1f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clippy_lints/src/future_not_send.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
99
use rustc_span::def_id::LocalDefId;
1010
use rustc_span::{sym, Span};
1111
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt;
12-
use rustc_trait_selection::traits::{self, FulfillmentError};
12+
use rustc_trait_selection::traits::{self, FulfillmentError, ObligationCtxt};
1313

1414
declare_clippy_lint! {
1515
/// ### What it does
@@ -79,8 +79,10 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
7979
let send_trait = cx.tcx.get_diagnostic_item(sym::Send).unwrap();
8080
let span = decl.output.span();
8181
let infcx = cx.tcx.infer_ctxt().build();
82+
let ocx = ObligationCtxt::new(&infcx);
8283
let cause = traits::ObligationCause::misc(span, fn_def_id);
83-
let send_errors = traits::fully_solve_bound(&infcx, cause, cx.param_env, ret_ty, send_trait);
84+
ocx.register_bound(cause, cx.param_env, ret_ty, send_trait);
85+
let send_errors = ocx.select_all_or_error();
8486
if !send_errors.is_empty() {
8587
span_lint_and_then(
8688
cx,

0 commit comments

Comments
 (0)