Skip to content

Commit

Permalink
Use Reveal::All in MIR inliner
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser committed Mar 22, 2020
1 parent 4f40511 commit 61d3be8
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/librustc_mir/transform/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc::mir::visit::*;
use rustc::mir::*;
use rustc::ty::subst::{InternalSubsts, Subst, SubstsRef};
use rustc::ty::{self, Instance, InstanceDef, ParamEnv, Ty, TyCtxt, TypeFoldable};
use rustc::ty::subst::{Subst, SubstsRef};
use rustc::ty::{self, Instance, InstanceDef, ParamEnv, Ty, TyCtxt};
use rustc_attr as attr;
use rustc_hir::def_id::DefId;
use rustc_index::bit_set::BitSet;
Expand Down Expand Up @@ -66,14 +66,7 @@ impl Inliner<'tcx> {

let mut callsites = VecDeque::new();

let mut param_env = self.tcx.param_env(self.source.def_id());

let substs = &InternalSubsts::identity_for_item(self.tcx, self.source.def_id());

// For monomorphic functions, we can use `Reveal::All` to resolve specialized instances.
if !substs.needs_subst() {
param_env = param_env.with_reveal_all();
}
let param_env = self.tcx.param_env(self.source.def_id()).with_reveal_all();

// Only do inlining into fn bodies.
let id = self.tcx.hir().as_local_hir_id(self.source.def_id()).unwrap();
Expand Down

0 comments on commit 61d3be8

Please sign in to comment.