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 ab45660c75
commit e94779a396

View File

@ -79,7 +79,7 @@ fn check_fn(
let send_trait = cx.tcx.get_diagnostic_item(sym::Send).unwrap();
let span = decl.output.span();
let infcx = cx.tcx.infer_ctxt().build();
let ocx = ObligationCtxt::new(&infcx);
let ocx = ObligationCtxt::new_with_diagnostics(&infcx);
let cause = traits::ObligationCause::misc(span, fn_def_id);
ocx.register_bound(cause, cx.param_env, ret_ty, send_trait);
let send_errors = ocx.select_all_or_error();