Skip to content

Commit

Permalink
Auto merge of rust-lang#99743 - compiler-errors:fulfillment-context-c…
Browse files Browse the repository at this point in the history
…leanups, r=jackh726

Some `FulfillmentContext`-related cleanups

Use `ObligationCtxt` in some places, remove some `FulfillmentContext`s in others...

r? types
  • Loading branch information
bors committed Aug 6, 2022
2 parents f232402 + ccbc965 commit f719599
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions clippy_lints/src/future_not_send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f719599

Please sign in to comment.