Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ccbc965

Browse files
Add traits::fully_solve_obligation that acts like traits::fully_normalize
It spawns up a trait engine, registers the single obligation, then fully solves it
1 parent 7aaeee7 commit ccbc965

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clippy_lints/src/future_not_send.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_middle::ty::{EarlyBinder, Opaque, PredicateKind::Trait};
99
use rustc_session::{declare_lint_pass, declare_tool_lint};
1010
use rustc_span::{sym, Span};
1111
use rustc_trait_selection::traits::error_reporting::suggestions::InferCtxtExt;
12-
use rustc_trait_selection::traits::{self, FulfillmentError, TraitEngine};
12+
use rustc_trait_selection::traits::{self, FulfillmentError};
1313

1414
declare_clippy_lint! {
1515
/// ### What it does
@@ -80,9 +80,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
8080
let span = decl.output.span();
8181
let send_errors = cx.tcx.infer_ctxt().enter(|infcx| {
8282
let cause = traits::ObligationCause::misc(span, hir_id);
83-
let mut fulfillment_cx = traits::FulfillmentContext::new();
84-
fulfillment_cx.register_bound(&infcx, cx.param_env, ret_ty, send_trait, cause);
85-
fulfillment_cx.select_all_or_error(&infcx)
83+
traits::fully_solve_bound(&infcx, cause, cx.param_env, ret_ty, send_trait)
8684
});
8785
if !send_errors.is_empty() {
8886
span_lint_and_then(

0 commit comments

Comments
 (0)