Function rustc_metadata::source ·
rmeta:: encoder:: should_encode_mir
fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool)
Whether we should encode MIR.
Computing, optimizing and encoding the MIR is a relatively expensive operation. We want to avoid this work when not required. Therefore:
- we only compute
mir_for_ctfeon items with const-eval semantics;
- we skip
optimized_mirfor check runs.
Return a pair, resp. for CTFE and for LLVM.