Make recursion limit fatal in project
This avoid the hang/oom from #79714
This commit is contained in:
@@ -734,7 +734,14 @@ fn project_type<'cx, 'tcx>(
|
||||
|
||||
if !selcx.tcx().sess.recursion_limit().value_within_limit(obligation.recursion_depth) {
|
||||
debug!("project: overflow!");
|
||||
return Err(ProjectionTyError::TraitSelectionError(SelectionError::Overflow));
|
||||
match selcx.query_mode() {
|
||||
super::TraitQueryMode::Standard => {
|
||||
selcx.infcx().report_overflow_error(&obligation, true);
|
||||
}
|
||||
super::TraitQueryMode::Canonical => {
|
||||
return Err(ProjectionTyError::TraitSelectionError(SelectionError::Overflow));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let obligation_trait_ref = &obligation.predicate.trait_ref(selcx.tcx());
|
||||
|
||||
Reference in New Issue
Block a user