We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23d415a commit d88420aCopy full SHA for d88420a
compiler/rustc_metadata/src/rmeta/encoder.rs
@@ -783,6 +783,11 @@ fn should_encode_stability(def_kind: DefKind) -> bool {
783
784
/// Whether we should encode MIR.
785
///
786
+/// Computing, optimizing and encoding the MIR is a relatively expensive operation.
787
+/// We want to avoid this work when not required. Therefore:
788
+/// - we only compute `mir_for_ctfe` on items with const-eval semantics;
789
+/// - we skip `optimized_mir` for check runs.
790
+///
791
/// Return a pair, resp. for CTFE and for LLVM.
792
fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool) {
793
match tcx.def_kind(def_id) {
0 commit comments