We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
any
1 parent 24c34d7 commit fe86ce6Copy full SHA for fe86ce6
clippy_lints/src/future_not_send.rs
@@ -80,10 +80,10 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
80
&& let Some(send_trait) = cx.tcx.get_diagnostic_item(sym::Send)
81
&& let preds = cx.tcx.explicit_item_self_bounds(def_id)
82
// If is a Future
83
- && preds.iter_instantiated_copied(cx.tcx, args).any(|(p, _)| {
84
- p.as_trait_clause()
85
- .is_some_and(|trait_pred| trait_pred.skip_binder().trait_ref.def_id == future_trait)
86
- })
+ && preds
+ .iter_instantiated_copied(cx.tcx, args)
+ .filter_map(|(p, _)| p.as_trait_clause())
+ .any(|trait_pred| trait_pred.skip_binder().trait_ref.def_id == future_trait)
87
{
88
let span = decl.output.span();
89
let infcx = cx.tcx.infer_ctxt().build(cx.typing_mode());
0 commit comments