about summary refs log tree commit diff
path: root/compiler/rustc_next_trait_solver/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-02-05 17:27:24 +0000
committerMichael Goulet <michael@errs.io>2025-02-21 18:24:05 +0000
commit241a602d2714d98e65727bce01c7f1e17021b645 (patch)
tree608d931a4ef36b245f51e1fcb85d62eb15ed40a9 /compiler/rustc_next_trait_solver/src
parent71e06b9c59d6af50fdc55aed75620493d29baf98 (diff)
downloadrust-241a602d2714d98e65727bce01c7f1e17021b645.tar.gz
rust-241a602d2714d98e65727bce01c7f1e17021b645.zip
Make sure we don't overrun the stack in canonicalizer
Diffstat (limited to 'compiler/rustc_next_trait_solver/src')
-rw-r--r--compiler/rustc_next_trait_solver/src/canonicalizer.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_next_trait_solver/src/canonicalizer.rs b/compiler/rustc_next_trait_solver/src/canonicalizer.rs
index 7eeed721d5a..9cae7f27947 100644
--- a/compiler/rustc_next_trait_solver/src/canonicalizer.rs
+++ b/compiler/rustc_next_trait_solver/src/canonicalizer.rs
@@ -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));
             }
         };