1
Fork 0

Make sure we don't overrun the stack in canonicalizer

This commit is contained in:
Michael Goulet 2025-02-05 17:27:24 +00:00
parent 71e06b9c59
commit 241a602d27
2 changed files with 65 additions and 6 deletions

View file

@ -1,6 +1,6 @@
use std::cmp::Ordering;
use rustc_type_ir::data_structures::HashMap;
use rustc_type_ir::data_structures::{HashMap, ensure_sufficient_stack};
use rustc_type_ir::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
use rustc_type_ir::inherent::*;
use rustc_type_ir::solve::{Goal, QueryInput};
@ -389,7 +389,7 @@ impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
| ty::Alias(_, _)
| ty::Bound(_, _)
| ty::Error(_) => {
return t.super_fold_with(self);
return ensure_sufficient_stack(|| t.super_fold_with(self));
}
};