Skip to content

Commit 8efafa1

Browse files
committedSep 21, 2018
Extend MIR inlining to all operand variants
1 parent 3bc2ca7 commit 8efafa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/librustc_mir/transform/inline.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> {
9494
// Only consider direct calls to functions
9595
let terminator = bb_data.terminator();
9696
if let TerminatorKind::Call {
97-
func: Operand::Constant(ref f), .. } = terminator.kind {
98-
if let ty::FnDef(callee_def_id, substs) = f.ty.sty {
97+
func: ref op, .. } = terminator.kind {
98+
if let ty::FnDef(callee_def_id, substs) = op.ty(caller_mir, self.tcx).sty {
9999
if let Some(instance) = Instance::resolve(self.tcx,
100100
param_env,
101101
callee_def_id,

0 commit comments

Comments
 (0)
Please sign in to comment.