diff options
| author | bors <bors@rust-lang.org> | 2021-11-09 11:16:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-09 11:16:38 +0000 |
| commit | eee8b9c7bafade55981d155dae71657f1cc55a22 (patch) | |
| tree | c080e3bab0af37d20ea68fdb20ce15c2ed3e623b /src | |
| parent | 214cd1f228a463b59f73ee46c8ae3b30f85de253 (diff) | |
| parent | d863021521c57cec83da08f361ba13a3c3a2483a (diff) | |
| download | rust-eee8b9c7bafade55981d155dae71657f1cc55a22.tar.gz rust-eee8b9c7bafade55981d155dae71657f1cc55a22.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/future_not_send.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/clippy/clippy_lints/src/future_not_send.rs b/src/tools/clippy/clippy_lints/src/future_not_send.rs index e18442515b8..6b2ac985555 100644 --- a/src/tools/clippy/clippy_lints/src/future_not_send.rs +++ b/src/tools/clippy/clippy_lints/src/future_not_send.rs @@ -77,13 +77,13 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend { if is_future { let send_trait = cx.tcx.get_diagnostic_item(sym::Send).unwrap(); let span = decl.output.span(); - let send_result = cx.tcx.infer_ctxt().enter(|infcx| { + 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) }); - if let Err(send_errors) = send_result { + if !send_errors.is_empty() { span_lint_and_then( cx, FUTURE_NOT_SEND, |
