diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-07-10 19:49:32 +0200 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2025-07-10 19:49:32 +0200 |
| commit | 341f12df67946faf630e6a656f12e504e9721d44 (patch) | |
| tree | 9e775cbf755ab7f26a7d5adb07b56420cb77be98 /compiler | |
| parent | e43d139a82620a268d3828a73e12a8679339e8f8 (diff) | |
| download | rust-341f12df67946faf630e6a656f12e504e9721d44.tar.gz rust-341f12df67946faf630e6a656f12e504e9721d44.zip | |
Properly track the depth when expanding free alias types
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/ty/util.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 69b8be3d9cb..fd80d85f198 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -1052,9 +1052,11 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for FreeAliasTypeExpander<'tcx> { } self.depth += 1; - ensure_sufficient_stack(|| { + let ty = ensure_sufficient_stack(|| { self.tcx.type_of(alias.def_id).instantiate(self.tcx, alias.args).fold_with(self) - }) + }); + self.depth -= 1; + ty } fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { |
