Skip to content

Commit b884205

Browse files
committed
review comments
1 parent bc1bd95 commit b884205

File tree

1 file changed

+5
-9
lines changed
  • src/librustc_typeck/check

1 file changed

+5
-9
lines changed

src/librustc_typeck/check/mod.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,9 @@ impl Inherited<'a, 'tcx> {
705705
span_bug!(obligation.cause.span, "escaping bound vars in predicate {:?}",
706706
obligation);
707707
}
708-
let _ = self.fulfillment_cx
709-
.try_borrow_mut()
710-
.map_err(|e| self.tcx.sess.delay_span_bug(obligation.cause.span, &format!(
711-
"fullfillment context already borrowed: {:?} - {:?}",
712-
e,
713-
obligation,
714-
)))
715-
.map(|mut cx| cx.register_predicate_obligation(self, obligation));
708+
self.fulfillment_cx
709+
.borrow_mut()
710+
.register_predicate_obligation(self, obligation);
716711
}
717712

718713
fn register_predicates<I>(&self, obligations: I)
@@ -3111,7 +3106,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
31113106
fallback_has_occurred: bool,
31123107
mutate_fullfillment_errors: impl Fn(&mut Vec<traits::FulfillmentError<'tcx>>),
31133108
) {
3114-
if let Err(mut errors) = self.fulfillment_cx.borrow_mut().select_where_possible(self) {
3109+
let result = self.fulfillment_cx.borrow_mut().select_where_possible(self);
3110+
if let Err(mut errors) = result {
31153111
mutate_fullfillment_errors(&mut errors);
31163112
self.report_fulfillment_errors(&errors, self.inh.body_id, fallback_has_occurred);
31173113
}

0 commit comments

Comments
 (0)