1
Fork 0

Make select_* methods return Vec for TraitEngine

This commit is contained in:
Deadbeef 2021-11-08 23:35:23 +08:00
parent b3074819f6
commit f1126f1272
No known key found for this signature in database
GPG key ID: 027DF9338862ADDD
25 changed files with 147 additions and 117 deletions

View file

@ -1054,8 +1054,9 @@ fn check_return_ty_is_sync(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, hir_id: HirId)
let mut fulfillment_cx = traits::FulfillmentContext::new();
let sync_def_id = tcx.require_lang_item(LangItem::Sync, Some(body.span));
fulfillment_cx.register_bound(&infcx, ty::ParamEnv::empty(), ty, sync_def_id, cause);
if let Err(err) = fulfillment_cx.select_all_or_error(&infcx) {
infcx.report_fulfillment_errors(&err, None, false);
let errors = fulfillment_cx.select_all_or_error(&infcx);
if !errors.is_empty() {
infcx.report_fulfillment_errors(&errors, None, false);
}
});
}