From b6314bc6bda7303f0fee2648af4de18f8984ef53 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 16 Mar 2024 16:50:20 -0700 Subject: [PATCH] Refactor inferred bound filtering --- src/expand.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/expand.rs b/src/expand.rs index bb37597..237d92f 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -267,12 +267,9 @@ fn transform_sig( &[InferredBound::Send] }; - let bounds = bounds.iter().filter(|bound| { - let assume_bound = match context { - Context::Trait { supertraits, .. } => !has_default || has_bound(supertraits, bound), - Context::Impl { .. } => true, - }; - !assume_bound + let bounds = bounds.iter().filter(|bound| match context { + Context::Trait { supertraits, .. } => has_default && !has_bound(supertraits, bound), + Context::Impl { .. } => false, }); where_clause_or_default(&mut sig.generics.where_clause)