Skip to content

Commit

Permalink
Address review.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Feb 3, 2021
1 parent 5a60f0a commit 0658d8c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,14 +810,10 @@ fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool) {
// Only check the presence of the `const` modifier.
let is_const_fn = tcx.is_const_fn_raw(def_id.to_def_id());
let always_encode_mir = tcx.sess.opts.debugging_opts.always_encode_mir;
(is_const_fn, needs_inline || is_const_fn || always_encode_mir)
(is_const_fn, needs_inline || always_encode_mir)
}
// Generators require optimized MIR to compute layout.
DefKind::Generator => {
// Only check the presence of the `const` modifier.
let is_const_fn = tcx.is_const_fn_raw(def_id.to_def_id());
(is_const_fn, true)
}
DefKind::Generator => (false, true),
// The others don't have MIR.
_ => (false, false),
}
Expand Down

0 comments on commit 0658d8c

Please sign in to comment.