Skip to content

Commit cb3db70

Browse files
estebankMark-Simulacrum
authored andcommitted
review comments
1 parent 1614b7f commit cb3db70

File tree

2 files changed

+10
-14
lines changed
  • compiler/rustc_trait_selection/src/traits

2 files changed

+10
-14
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ where
118118
// contains unbound type parameters. It could be a slight
119119
// optimization to stop iterating early.
120120
if let Err(errors) = fulfill_cx.select_all_or_error(infcx) {
121-
bug!("Encountered errors `{:?}` resolving bounds after type-checking", errors);
121+
infcx.tcx.sess.delay_span_bug(
122+
rustc_span::DUMMY_SP,
123+
&format!("Encountered errors `{:?}` resolving bounds after type-checking", errors),
124+
);
122125
}
123126

124127
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
@@ -1951,19 +1951,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
19511951
&predicate.subst(tcx, substs),
19521952
&mut obligations,
19531953
);
1954-
if predicate.references_error() {
1955-
self.tcx().sess.delay_span_bug(
1956-
cause.span,
1957-
&format!("impl_or_trait_obligation with errors: {:?}", predicate),
1958-
);
1959-
} else {
1960-
obligations.push(Obligation {
1961-
cause: cause.clone(),
1962-
recursion_depth,
1963-
param_env,
1964-
predicate,
1965-
});
1966-
}
1954+
obligations.push(Obligation {
1955+
cause: cause.clone(),
1956+
recursion_depth,
1957+
param_env,
1958+
predicate,
1959+
});
19671960
}
19681961

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

0 commit comments

Comments
 (0)