Skip to content

Commit 36d5475

Browse files
committed
Auto merge of #90700 - fee1-dead:select-returns-vec, r=davidtwco
Make `select_*` methods return `Vec` for `TraitEngine` This reduces some complexity as an empty vec means no errors and non-empty vec means errors occurred.
2 parents 0332a7b + 6d23824 commit 36d5475

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/future_not_send.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
7777
if is_future {
7878
let send_trait = cx.tcx.get_diagnostic_item(sym::Send).unwrap();
7979
let span = decl.output.span();
80-
let send_result = cx.tcx.infer_ctxt().enter(|infcx| {
80+
let send_errors = cx.tcx.infer_ctxt().enter(|infcx| {
8181
let cause = traits::ObligationCause::misc(span, hir_id);
8282
let mut fulfillment_cx = traits::FulfillmentContext::new();
8383
fulfillment_cx.register_bound(&infcx, cx.param_env, ret_ty, send_trait, cause);
8484
fulfillment_cx.select_all_or_error(&infcx)
8585
});
86-
if let Err(send_errors) = send_result {
86+
if !send_errors.is_empty() {
8787
span_lint_and_then(
8888
cx,
8989
FUTURE_NOT_SEND,

0 commit comments

Comments
 (0)