File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
compiler/rustc_infer/src/infer/relate Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11use std:: mem;
22
33use rustc_data_structures:: sso:: SsoHashMap ;
4+ use rustc_data_structures:: stack:: ensure_sufficient_stack;
45use rustc_hir:: def_id:: DefId ;
56use rustc_middle:: infer:: unify_key:: { ConstVarValue , ConstVariableValue } ;
67use rustc_middle:: ty:: error:: TypeError ;
@@ -226,7 +227,9 @@ where
226227 let old_ambient_variance = self . ambient_variance ;
227228 self . ambient_variance = self . ambient_variance . xform ( variance) ;
228229 debug ! ( ?self . ambient_variance, "new ambient variance" ) ;
229- let r = self . relate ( a, b) ?;
230+ // Recursive calls to `relate` can overflow the stack. For example a deeper version of
231+ // `ui/associated-consts/issue-93775.rs`.
232+ let r = ensure_sufficient_stack ( || self . relate ( a, b) ) ?;
230233 self . ambient_variance = old_ambient_variance;
231234 Ok ( r)
232235 }
You can’t perform that action at this time.
0 commit comments