diff options
| author | Michael Goulet <michael@errs.io> | 2023-08-13 22:21:55 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-08-13 22:22:15 +0000 |
| commit | b6b5a65ae6714f39a2d2dcf5909fee9f64dd4dcd (patch) | |
| tree | 0d1c024bc25471e34a7e11531169beba73a6fb12 /compiler/rustc_hir_analysis/src/check | |
| parent | ebbd7154a713a282e4b39da5107cdae2bf2efcb4 (diff) | |
| download | rust-b6b5a65ae6714f39a2d2dcf5909fee9f64dd4dcd.tar.gz rust-b6b5a65ae6714f39a2d2dcf5909fee9f64dd4dcd.zip | |
Select obligations before processing wf obligation in compare_method_predicate_entailment
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/compare_impl_item.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs index 044fb405e32..ad02ca252c4 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs @@ -308,6 +308,15 @@ fn compare_method_predicate_entailment<'tcx>( } if check_implied_wf == CheckImpliedWfMode::Check && !(impl_sig, trait_sig).references_error() { + // Select obligations to make progress on inference before processing + // the wf obligation below. + // FIXME(-Ztrait-solver=next): Not needed when the hack below is removed. + let errors = ocx.select_where_possible(); + if !errors.is_empty() { + let reported = infcx.err_ctxt().report_fulfillment_errors(&errors); + return Err(reported); + } + // See #108544. Annoying, we can end up in cases where, because of winnowing, // we pick param env candidates over a more general impl, leading to more // stricter lifetime requirements than we would otherwise need. This can @@ -378,7 +387,7 @@ fn compare_method_predicate_entailment<'tcx>( // lifetime parameters. let outlives_env = OutlivesEnvironment::with_bounds( param_env, - infcx.implied_bounds_tys(param_env, impl_m_def_id, wf_tys.clone()), + infcx.implied_bounds_tys(param_env, impl_m_def_id, wf_tys), ); let errors = infcx.resolve_regions(&outlives_env); if !errors.is_empty() { |
