Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Oct 23, 2020
1 parent b334eef commit f71e9ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
5 changes: 4 additions & 1 deletion compiler/rustc_trait_selection/src/traits/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ where
// contains unbound type parameters. It could be a slight
// optimization to stop iterating early.
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);
Expand Down
19 changes: 6 additions & 13 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2031,19 +2031,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
&predicate.subst(tcx, substs),
&mut obligations,
);
if predicate.references_error() {
self.tcx().sess.delay_span_bug(
cause.span,
&format!("impl_or_trait_obligation with errors: {:?}", predicate),
);
} else {
obligations.push(Obligation {
cause: cause.clone(),
recursion_depth,
param_env,
predicate,
});
}
obligations.push(Obligation {
cause: cause.clone(),
recursion_depth,
param_env,
predicate,
});
}

// We are performing deduplication here to avoid exponential blowups
Expand Down

0 comments on commit f71e9ed

Please sign in to comment.