1
Fork 0

review comments

This commit is contained in:
Esteban Küber 2020-10-23 12:51:06 -07:00
parent b334eef162
commit f71e9ed7f1
2 changed files with 10 additions and 14 deletions

View file

@ -121,7 +121,10 @@ where
// contains unbound type parameters. It could be a slight // contains unbound type parameters. It could be a slight
// optimization to stop iterating early. // optimization to stop iterating early.
if let Err(errors) = fulfill_cx.select_all_or_error(infcx) { if let Err(errors) = fulfill_cx.select_all_or_error(infcx) {
bug!("Encountered errors `{:?}` resolving bounds after type-checking", errors); infcx.tcx.sess.delay_span_bug(
rustc_span::DUMMY_SP,
&format!("Encountered errors `{:?}` resolving bounds after type-checking", errors),
);
} }
let result = infcx.resolve_vars_if_possible(result); let result = infcx.resolve_vars_if_possible(result);

View file

@ -2031,19 +2031,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
&predicate.subst(tcx, substs), &predicate.subst(tcx, substs),
&mut obligations, &mut obligations,
); );
if predicate.references_error() { obligations.push(Obligation {
self.tcx().sess.delay_span_bug( cause: cause.clone(),
cause.span, recursion_depth,
&format!("impl_or_trait_obligation with errors: {:?}", predicate), param_env,
); predicate,
} else { });
obligations.push(Obligation {
cause: cause.clone(),
recursion_depth,
param_env,
predicate,
});
}
} }
// We are performing deduplication here to avoid exponential blowups // We are performing deduplication here to avoid exponential blowups