Matthias Krüger ddcb9c132a
Rollup merge of #130201 - compiler-errors:foreign-synthetic-body, r=lcnr
Encode `coroutine_by_move_body_def_id` in crate metadata

We synthesize the MIR for a by-move body for the `FnOnce` implementation of async closures. It can be accessed with the `coroutine_by_move_body_def_id` query. We weren't encoding this query in the metadata though, nor were we properly recording that synthetic MIR in `mir_keys`, so the `optimized_mir` wasn't getting encoded either!

Stacked on top is a fix to consider `DefKind::SyntheticCoroutineBody` to return true in several places I missed. Specifically, we should consider the def-kind in `fn DefKind::is_fn_like()`, since that's what we were using to make sure we ensure `query mir_inliner_callees` before the MIR gets stolen for the body. This led to some CI failures that were caught by miri but which I added a test for.
2024-09-17 17:28:32 +02:00
..
2024-09-10 08:42:30 +10:00
2024-09-10 08:54:17 +10:00
2024-09-13 16:27:24 +10:00
2024-09-10 08:42:30 +10:00
2024-09-10 08:54:22 +10:00
2024-09-16 20:06:16 -04:00
2024-09-10 08:42:30 +10:00
2024-09-10 08:42:30 +10:00
2024-09-10 08:54:17 +10:00
2024-09-13 15:46:20 +10:00