Skip to content

Commit d88420a

Browse files
committed
Review comment.
1 parent 23d415a commit d88420a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

+5
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,11 @@ fn should_encode_stability(def_kind: DefKind) -> bool {
783783

784784
/// Whether we should encode MIR.
785785
///
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+
///
786791
/// Return a pair, resp. for CTFE and for LLVM.
787792
fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool) {
788793
match tcx.def_kind(def_id) {

0 commit comments

Comments
 (0)