From d0b0b028a68eaee609b235a8cb5627466b2d79fb Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 27 Jan 2025 19:15:37 +0000 Subject: Eagerly detect coroutine recursion pre-mono when possible --- compiler/rustc_interface/src/passes.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 8a121c5a865..9c5f30012e7 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -909,6 +909,11 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { tcx.ensure_ok().check_coroutine_obligations( tcx.typeck_root_def_id(def_id.to_def_id()).expect_local(), ); + // Eagerly check the unsubstituted layout for cycles. + tcx.ensure_ok().layout_of( + ty::TypingEnv::post_analysis(tcx, def_id.to_def_id()) + .as_query_input(tcx.type_of(def_id).instantiate_identity()), + ); } }); }); -- cgit 1.4.1-3-g733a5