Skip to content

Commit 39d44e7

Browse files
committed
Combine drain_filter calls
1 parent 851f2b2 commit 39d44e7

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+4
-4
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -946,13 +946,13 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
946946
};
947947

948948
let mut deduped: SsoHashSet<_> = Default::default();
949-
result
950-
.obligations
951-
.drain_filter(|sub_obligation| !deduped.insert(sub_obligation.clone()));
952-
953949
let mut canonical =
954950
SelectionContext::with_query_mode(selcx.infcx(), TraitQueryMode::Canonical);
951+
955952
result.obligations.drain_filter(|projected_obligation| {
953+
if !deduped.insert(projected_obligation.clone()) {
954+
return true;
955+
}
956956
// If any global obligations always apply, considering regions, then we don't
957957
// need to include them. The `is_global` check rules out inference variables,
958958
// so there's no need for the caller of `opt_normalize_projection_type`

0 commit comments

Comments
 (0)