diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2023-01-23 19:29:59 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-23 19:29:59 +0900 |
| commit | 17023496a227967cb407ad2e911014744af262e2 (patch) | |
| tree | 85c579fa3c0a4ecc7e617946b03df436efa3492c | |
| parent | ae15d1094a1185e965a3de1672c5159546af9863 (diff) | |
| parent | 096f4547740ba0c945602ad6006f65bdd20f3418 (diff) | |
| download | rust-17023496a227967cb407ad2e911014744af262e2.tar.gz rust-17023496a227967cb407ad2e911014744af262e2.zip | |
Rollup merge of #107101 - compiler-errors:perf-106309-1, r=petrochenkov
Filter param-env predicates for errors before calling `to_opt_poly_trait_pred` cc #106309 https://github.com/rust-lang/rust/pull/106757#issuecomment-1396616318 r? `@ghost`
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index 2733d9643fd..87d574ff107 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -174,8 +174,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { .param_env .caller_bounds() .iter() - .filter_map(|p| p.to_opt_poly_trait_pred()) - .filter(|p| !p.references_error()); + .filter(|p| !p.references_error()) + .filter_map(|p| p.to_opt_poly_trait_pred()); // Micro-optimization: filter out predicates relating to different traits. let matching_bounds = |
