rust/compiler/rustc_mir_transform/src
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
..
coroutine Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
coverage coverage: Remove unnecessary bcb_successors 2024-09-15 12:51:57 +10:00
inline Remove #[macro_use] extern crate tracing from rustc_mir_transform. 2024-08-30 10:01:34 +10:00
shim Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
abort_unwinding_calls.rs Streamline AbortUnwindingCalls. 2024-09-09 15:15:42 +10:00
add_call_guards.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
add_moves_for_packed_drops.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
add_retag.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
add_subtyping_projections.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
check_alignment.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
check_const_item_mutation.rs Simplify some nested if statements 2024-09-11 13:45:23 -04:00
check_packed_ref.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
cleanup_post_borrowck.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
copy_prop.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
coroutine.rs Rename FlowState as Domain. 2024-09-13 16:27:24 +10:00
cost_checker.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
cross_crate_inline.rs Fix a couple more DefKind discrepancies between DefKind::Closure and DefKind::SyntheticCoroutineBody 2024-09-16 22:09:42 -04:00
ctfe_limit.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
dataflow_const_prop.rs Rollup merge of #130294 - nnethercote:more-lifetimes, r=lcnr 2024-09-14 18:12:13 +02:00
dead_store_elimination.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
deduce_param_attrs.rs Simplify some nested if statements 2024-09-11 13:45:23 -04:00
deduplicate_blocks.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
deref_separator.rs Use LocalDecls in a couple of places. 2024-09-09 15:15:44 +10:00
dest_prop.rs Remove references from some structs. 2024-09-10 09:11:17 +10:00
dump_mir.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
early_otherwise_branch.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
elaborate_box_derefs.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
elaborate_drops.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
errors.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
ffi_unwind_calls.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
function_item_references.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
gvn.rs Simplify the canonical clone method to copy 2024-09-14 13:30:35 +08:00
inline.rs Remove semi-nondeterminism of DefPathHash ordering from inliner 2024-09-16 21:41:15 -04:00
instsimplify.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
jump_threading.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
known_panics_lint.rs Simplify some nested if statements 2024-09-11 13:45:23 -04:00
large_enums.rs Add a useful comment. 2024-09-10 08:54:22 +10:00
lib.rs Record synthetic MIR bodies in mir_keys 2024-09-16 20:06:16 -04:00
lint.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
lower_intrinsics.rs Improve consistency in LowerIntrinsics. 2024-09-09 15:15:44 +10:00
lower_slice_len.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
match_branches.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
mentioned_items.rs Remove references from some structs. 2024-09-10 09:11:17 +10:00
multiple_return_terminators.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
nrvo.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
pass_manager.rs Rollup merge of #130101 - RalfJung:const-cleanup, r=fee1-dead 2024-09-12 19:03:41 +02:00
post_drop_elaboration.rs Make check_live_drops into a MirLint. 2024-09-10 09:11:17 +10:00
prettify.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
promote_consts.rs Add a useful comment about PromoteTemps. 2024-09-10 08:54:45 +10:00
ref_prop.rs Remove references from some structs. 2024-09-10 09:11:17 +10:00
remove_noop_landing_pads.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
remove_place_mention.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
remove_storage_markers.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
remove_uninit_drops.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
remove_unneeded_drops.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
remove_zsts.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
required_consts.rs Remove references from some structs. 2024-09-10 09:11:17 +10:00
reveal_all.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
sanity_check.rs Move MirPass to rustc_mir_transform. 2024-09-03 16:03:46 +10:00
shim.rs Don't ICE when generating Fn shim for async closure with borrowck error 2024-09-16 10:57:58 -04:00
simplify_branches.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
simplify_comparison_integral.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
simplify.rs Inline and remove some functions. 2024-09-10 08:54:17 +10:00
single_use_consts.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
sroa.rs Reduce visibilities, and add warn(unreachable_pub). 2024-09-09 08:48:09 +10:00
ssa.rs Rename and reorder lots of lifetimes. 2024-09-13 15:46:20 +10:00
unreachable_enum_branching.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
unreachable_prop.rs Improve comment formatting. 2024-09-10 08:42:30 +10:00
validate.rs Rollup merge of #130199 - compiler-errors:by-move, r=cjgillot 2024-09-14 11:53:12 +10:00