about summary refs log tree commit diff
path: root/compiler/rustc_borrowck
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-12 10:32:55 +0000
committerbors <bors@rust-lang.org>2021-09-12 10:32:55 +0000
commit9ef27bf7dc50a8b51435579b4f2e86f7ee3f7a94 (patch)
treef8644fe71c3127b66b5a7b4f9495a946563e93f0 /compiler/rustc_borrowck
parent0212c70b1df2aa542aef48d5fcde0af3734970c6 (diff)
parent8e7613f9e0366a012cd6d4765b5a2d568d108029 (diff)
downloadrust-9ef27bf7dc50a8b51435579b4f2e86f7ee3f7a94.tar.gz
rust-9ef27bf7dc50a8b51435579b4f2e86f7ee3f7a94.zip
Auto merge of #88771 - jackh726:wf_tys_set, r=nikomatsakis
Use FxHashSet instead of Vec for well formed tys

Trying to recover perf from #88312

r? `@ghost`
Diffstat (limited to 'compiler/rustc_borrowck')
-rw-r--r--compiler/rustc_borrowck/src/type_check/free_region_relations.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
index e1e8f6a61ad..70c74940d62 100644
--- a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
+++ b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
@@ -259,7 +259,7 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
                 // We add implied bounds from both the unnormalized and normalized ty
                 // See issue #87748
                 let constraints_implied_1 = self.add_implied_bounds(ty);
-                let TypeOpOutput { output: ty, constraints: constraints1, .. } = self
+                let TypeOpOutput { output: norm_ty, constraints: constraints1, .. } = self
                     .param_env
                     .and(type_op::normalize::Normalize::new(ty))
                     .fully_perform(self.infcx)
@@ -286,8 +286,9 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
                 // }
                 // ```
                 // Both &Self::Bar and &() are WF
-                let constraints_implied_2 = self.add_implied_bounds(ty);
-                normalized_inputs_and_output.push(ty);
+                let constraints_implied_2 =
+                    if ty != norm_ty { self.add_implied_bounds(norm_ty) } else { None };
+                normalized_inputs_and_output.push(norm_ty);
                 constraints1.into_iter().chain(constraints_implied_1).chain(constraints_implied_2)
             })
             .collect();