rust/compiler/rustc_mir_transform
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
..
src Rollup merge of #130201 - compiler-errors:foreign-synthetic-body, r=lcnr 2024-09-17 17:28:32 +02:00
Cargo.toml Simplify match based on the cast result of IntToInt. 2024-08-03 10:55:43 +08:00
messages.ftl Remove MIR unsafe check 2024-04-03 08:50:12 +00:00