Fix ice when error reporting recursion errors
Fixes: #90319, #92148, #93955
This commit is contained in:
parent
37b55c8a0c
commit
85e67b9a59
9 changed files with 66 additions and 14 deletions
|
@ -27,6 +27,7 @@ use rustc_hir::def::DefKind;
|
|||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_infer::infer::resolve::OpportunisticRegionResolver;
|
||||
use rustc_middle::traits::select::OverflowError;
|
||||
use rustc_middle::ty::fold::{TypeFoldable, TypeFolder};
|
||||
use rustc_middle::ty::subst::Subst;
|
||||
use rustc_middle::ty::{self, Term, ToPredicate, Ty, TyCtxt};
|
||||
|
@ -1139,7 +1140,9 @@ fn project<'cx, 'tcx>(
|
|||
if !selcx.tcx().recursion_limit().value_within_limit(obligation.recursion_depth) {
|
||||
// This should really be an immediate error, but some existing code
|
||||
// relies on being able to recover from this.
|
||||
return Err(ProjectionError::TraitSelectionError(SelectionError::Overflow));
|
||||
return Err(ProjectionError::TraitSelectionError(SelectionError::Overflow(
|
||||
OverflowError::Canonical,
|
||||
)));
|
||||
}
|
||||
|
||||
if obligation.predicate.references_error() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue