1
Fork 0

Eagerly detect coroutine recursion pre-mono when possible

This commit is contained in:
Michael Goulet 2025-01-27 19:15:37 +00:00
parent 820bfffc25
commit d0b0b028a6
12 changed files with 37 additions and 95 deletions

View file

@ -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()),
);
}
});
});