Skip to content

Commit

Permalink
Refactor inferred bound filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 16, 2024
1 parent 8d51928 commit b6314bc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6314bc

Please sign in to comment.