diff options
| author | Michael Goulet <michael@errs.io> | 2022-08-02 06:02:04 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-08-04 13:50:56 +0000 |
| commit | ccbc96508a5ff373f960ec0d904e1be41ad8c978 (patch) | |
| tree | 00b1d23bb275fb62b455321a4d0978602c945229 | |
| parent | 7aaeee734fd1c68ddf27464e3f68caa77c98c0b2 (diff) | |
| download | rust-ccbc96508a5ff373f960ec0d904e1be41ad8c978.tar.gz rust-ccbc96508a5ff373f960ec0d904e1be41ad8c978.zip | |
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
| -rw-r--r-- | clippy_lints/src/future_not_send.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clippy_lints/src/future_not_send.rs b/clippy_lints/src/future_not_send.rs index 5c46d6c7df7..ef7d75aa8ed 100644 --- a/clippy_lints/src/future_not_send.rs +++ b/clippy_lints/src/future_not_send.rs @@ -9,7 +9,7 @@ use rustc_middle::ty::{EarlyBinder, Opaque, PredicateKind::Trait}; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::{sym, Span}; use rustc_trait_selection::traits::error_reporting::suggestions::InferCtxtExt; -use rustc_trait_selection::traits::{self, FulfillmentError, TraitEngine}; +use rustc_trait_selection::traits::{self, FulfillmentError}; declare_clippy_lint! { /// ### What it does @@ -80,9 +80,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend { let span = decl.output.span(); let send_errors = cx.tcx.infer_ctxt().enter(|infcx| { let cause = traits::ObligationCause::misc(span, hir_id); - let mut fulfillment_cx = traits::FulfillmentContext::new(); - fulfillment_cx.register_bound(&infcx, cx.param_env, ret_ty, send_trait, cause); - fulfillment_cx.select_all_or_error(&infcx) + traits::fully_solve_bound(&infcx, cause, cx.param_env, ret_ty, send_trait) }); if !send_errors.is_empty() { span_lint_and_then( |
