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
25 changed files with 147 additions and 117 deletions

View File

@@ -187,9 +187,11 @@ impl<'tcx> AutoTraitFinder<'tcx> {
// an additional sanity check.
let mut fulfill = FulfillmentContext::new();
fulfill.register_bound(&infcx, full_env, ty, trait_did, ObligationCause::dummy());
fulfill.select_all_or_error(&infcx).unwrap_or_else(|e| {
panic!("Unable to fulfill trait {:?} for '{:?}': {:?}", trait_did, ty, e)
});
let errors = fulfill.select_all_or_error(&infcx);
if !errors.is_empty() {
panic!("Unable to fulfill trait {:?} for '{:?}': {:?}", trait_did, ty, errors);
}
let body_id_map: FxHashMap<_, _> = infcx
.inner