remove drain-on-drop behavior from vec::DrainFilter and add #[must_use]

This commit is contained in:
The 8472 2022-11-15 19:50:11 +01:00
parent fa8762b7b6
commit c0df1c8c43
6 changed files with 32 additions and 131 deletions

View file

@ -1170,11 +1170,11 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
};
let mut deduped: SsoHashSet<_> = Default::default();
result.obligations.drain_filter(|projected_obligation| {
result.obligations.retain(|projected_obligation| {
if !deduped.insert(projected_obligation.clone()) {
return true;
return false;
}
false
true
});
if use_cache {