Skip to content

Commit 7b2aeca

Browse files
committed
give a more informative failure in this case
1 parent 632f9c4 commit 7b2aeca

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/librustc/traits/query/evaluate_obligation.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
5151
let mut selcx =
5252
SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
5353
selcx.evaluate_obligation_recursively(obligation)
54-
.expect("Overflow should be caught earlier in standard query mode")
54+
.unwrap_or_else(|r| {
55+
span_bug!(
56+
obligation.cause.span,
57+
"Overflow should be caught earlier in standard query mode: {:?}, {:?}",
58+
obligation,
59+
r,
60+
)
61+
})
5562
}
5663
}
5764
}

0 commit comments

Comments
 (0)