diff options
| author | Michael Goulet <michael@errs.io> | 2023-01-20 03:20:17 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-01-20 03:20:17 +0000 |
| commit | 096f4547740ba0c945602ad6006f65bdd20f3418 (patch) | |
| tree | ba9df9b2fcfb146a705bddbbaca30c904e9a9d35 | |
| parent | 4c83bd03a9d94af35c97a6b8b595d40e291af84a (diff) | |
| download | rust-096f4547740ba0c945602ad6006f65bdd20f3418.tar.gz rust-096f4547740ba0c945602ad6006f65bdd20f3418.zip | |
Filter predicates first for fast-path type flags
| -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 = |
