diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-14 19:18:43 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-14 19:18:43 +0000 |
| commit | 2ada9ccb7d144075a6270aa94c20718be377148f (patch) | |
| tree | a0445c7dcb30dac2131e9f736f492575cf48bc88 /compiler/rustc_monomorphize | |
| parent | a567209daab72b7ea59eac533278064396bb0534 (diff) | |
| download | rust-2ada9ccb7d144075a6270aa94c20718be377148f.tar.gz rust-2ada9ccb7d144075a6270aa94c20718be377148f.zip | |
Normalize closure instance before eagerly monomorphizing it
Diffstat (limited to 'compiler/rustc_monomorphize')
| -rw-r--r-- | compiler/rustc_monomorphize/src/collector.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index ae31ed59391..e4a733fcbce 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -1509,6 +1509,13 @@ impl<'v> RootCollector<'_, 'v> { } _ => unreachable!(), }; + let Ok(instance) = self.tcx.try_normalize_erasing_regions( + ty::TypingEnv::fully_monomorphized(), + instance, + ) else { + // Don't ICE on an impossible-to-normalize closure. + return; + }; let mono_item = create_fn_mono_item(self.tcx, instance, DUMMY_SP); if mono_item.node.is_instantiable(self.tcx) { self.output.push(mono_item); |
