diff options
| author | The 8472 <git@infinite-source.de> | 2022-11-15 19:50:11 +0100 |
|---|---|---|
| committer | The 8472 <git@infinite-source.de> | 2023-06-14 09:24:51 +0200 |
| commit | c0df1c8c432e856c4317c5c7585c86c54bcb46a2 (patch) | |
| tree | 474ad9d4f0515a218559d7a49ab75055d24a2a16 /compiler/rustc_trait_selection/src | |
| parent | fa8762b7b6c2b75d6c83fb011ee8fa4874168829 (diff) | |
| download | rust-c0df1c8c432e856c4317c5c7585c86c54bcb46a2.tar.gz rust-c0df1c8c432e856c4317c5c7585c86c54bcb46a2.zip | |
remove drain-on-drop behavior from vec::DrainFilter and add #[must_use]
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 563cc257e03..0a1e971f268 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -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 { |
