Opt-in diagnostics reporting to avoid doing extra work in the new solver

This commit is contained in:
Michael Goulet
2024-06-01 14:51:31 -04:00
parent 54b2b7d460
commit eb0a70a557
31 changed files with 200 additions and 107 deletions

View File

@@ -50,7 +50,8 @@ pub fn codegen_select_candidate<'tcx>(
// Currently, we use a fulfillment context to completely resolve
// all nested obligations. This is because they can inform the
// inference of the impl's type parameters.
let ocx = ObligationCtxt::new(&infcx);
// FIXME(-Znext-solver): Doesn't need diagnostics if new solver.
let ocx = ObligationCtxt::new_with_diagnostics(&infcx);
let impl_source = selection.map(|obligation| {
ocx.register_obligation(obligation);
});