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`
This commit is contained in:
Yuki Okushi 2023-01-23 19:29:59 +09:00 committed by GitHub
commit 17023496a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,8 +174,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
.param_env .param_env
.caller_bounds() .caller_bounds()
.iter() .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. // Micro-optimization: filter out predicates relating to different traits.
let matching_bounds = let matching_bounds =