Skip to content

Commit 4e02ef3

Browse files
estebankMark-Simulacrum
authored andcommitted
review comments
1 parent de2b882 commit 4e02ef3

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

Lines changed: 5 additions & 9 deletions
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)
@@ -3015,7 +3010,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
30153010
fallback_has_occurred: bool,
30163011
mutate_fullfillment_errors: impl Fn(&mut Vec<traits::FulfillmentError<'tcx>>),
30173012
) {
3018-
if let Err(mut errors) = self.fulfillment_cx.borrow_mut().select_where_possible(self) {
3013+
let result = self.fulfillment_cx.borrow_mut().select_where_possible(self);
3014+
if let Err(mut errors) = result {
30193015
mutate_fullfillment_errors(&mut errors);
30203016
self.report_fulfillment_errors(&errors, self.inh.body_id, fallback_has_occurred);
30213017
}

0 commit comments

Comments
 (0)