diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-11-08 23:35:23 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-11-08 23:35:23 +0800 |
| commit | f1126f1272d21a5bee1694b5e9bb5f3cf19629d1 (patch) | |
| tree | 7e7fe2d16b81bd7203300aa1744c7fb8ee8cc075 /compiler/rustc_const_eval/src | |
| parent | b3074819f615758da44a667bf3cb98c59227e2f9 (diff) | |
Make select_* methods return Vec for TraitEngine
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/check_consts/check.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index 3785c170f6b..61fd828a430 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -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); } }); } |
