Skip to content

Commit

Permalink
Adjust imports
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 4, 2021
1 parent 7202054 commit f6d54aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_mir/src/monomorphize/polymorphize.rs
Expand Up @@ -5,7 +5,7 @@
//! generic parameters are unused (and eventually, in what ways generic parameters are used - only
//! for their size, offset of a field, etc.).

use rustc_hir::{def::DefKind, def_id::DefId};
use rustc_hir::{def::DefKind, def_id::DefId, ConstContext};
use rustc_index::bit_set::FiniteBitSet;
use rustc_middle::mir::{
visit::{TyContext, Visitor},
Expand Down Expand Up @@ -56,7 +56,7 @@ fn unused_generic_params(tcx: TyCtxt<'_>, def_id: DefId) -> FiniteBitSet<u32> {
// Exit early when there is no MIR available.
let context = tcx.hir().body_const_context(def_id.expect_local());
match context {
Some(ConstContext::Fn) | None if !tcx.is_mir_available(def_id) => {
Some(ConstContext::ConstFn) | None if !tcx.is_mir_available(def_id) => {
debug!("unused_generic_params: (no mir available) def_id={:?}", def_id);
return FiniteBitSet::new_empty();
}
Expand All @@ -80,7 +80,7 @@ fn unused_generic_params(tcx: TyCtxt<'_>, def_id: DefId) -> FiniteBitSet<u32> {
let body = match context {
// Const functions are actually called and should thus be considered for polymorphization
// via their runtime MIR
Some(ConstContext::Fn) | None => tcx.optimized_mir(def_id),
Some(ConstContext::ConstFn) | None => tcx.optimized_mir(def_id),
Some(_) => tcx.mir_for_ctfe(def_id),
};
let mut vis = MarkUsedGenericParams { tcx, def_id, unused_parameters: &mut unused_parameters };
Expand Down

0 comments on commit f6d54aa

Please sign in to comment.