Skip to content

Commit f71e9ed

Browse files
committed
review comments
1 parent b334eef commit f71e9ed

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

compiler/rustc_trait_selection/src/traits/codegen.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ where
121121
// contains unbound type parameters. It could be a slight
122122
// optimization to stop iterating early.
123123
if let Err(errors) = fulfill_cx.select_all_or_error(infcx) {
124-
bug!("Encountered errors `{:?}` resolving bounds after type-checking", errors);
124+
infcx.tcx.sess.delay_span_bug(
125+
rustc_span::DUMMY_SP,
126+
&format!("Encountered errors `{:?}` resolving bounds after type-checking", errors),
127+
);
125128
}
126129

127130
let result = infcx.resolve_vars_if_possible(result);

compiler/rustc_trait_selection/src/traits/select/mod.rs

+6-13
Original file line numberDiff line numberDiff line change
@@ -2031,19 +2031,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
20312031
&predicate.subst(tcx, substs),
20322032
&mut obligations,
20332033
);
2034-
if predicate.references_error() {
2035-
self.tcx().sess.delay_span_bug(
2036-
cause.span,
2037-
&format!("impl_or_trait_obligation with errors: {:?}", predicate),
2038-
);
2039-
} else {
2040-
obligations.push(Obligation {
2041-
cause: cause.clone(),
2042-
recursion_depth,
2043-
param_env,
2044-
predicate,
2045-
});
2046-
}
2034+
obligations.push(Obligation {
2035+
cause: cause.clone(),
2036+
recursion_depth,
2037+
param_env,
2038+
predicate,
2039+
});
20472040
}
20482041

20492042
// We are performing deduplication here to avoid exponential blowups

0 commit comments

Comments
 (0)