Make recursion limit fatal in project
This avoid the hang/oom from #79714
This commit is contained in:
parent
2ad5292aea
commit
77fce67733
2 changed files with 9 additions and 3 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue