Skip to content

Commit ab71589

Browse files
committed
Fix bug matching higher ranked bounds
1 parent 3fba9a8 commit ab71589

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎compiler/rustc_type_ir/src/param_env.rs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,12 @@ mod trait_filter {
645645
{
646646
#[inline]
647647
fn allow_clause(&self, clause: TraitClause<I>) -> bool {
648-
// When looking for a compressed trait, any normal clause can never match so we
649-
// return false unconditionally.
650-
if self.lang_item_compressed.is_some() {
651-
return false;
652-
}
653-
648+
// When looking for a compressed trait, you'd think no normal clause
649+
// can ever match so we could return false unconditionally when
650+
// self.lang_item_compressed is `None`. However, bound clauses are
651+
// never compressed, so in cases where we have `for<'a> T: Send`,
652+
// a `Send` bound which would otherwise be compressed is actually not,
653+
// and we should return it.
654654
clause.def_id() == self.def_id
655655
}
656656

0 commit comments

Comments
 (0)