Skip to content

Commit 821f4a9

Browse files
committed
Monomorphize const type during codegen.
1 parent 99a864b commit 821f4a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_codegen_ssa/mir/constant.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
3030
}
3131
_ => {
3232
let val = self.eval_mir_constant(constant)?;
33-
Ok(OperandRef::from_const(bx, val.clone(), constant.literal.ty))
33+
let ty = self.monomorphize(&constant.literal.ty);
34+
Ok(OperandRef::from_const(bx, val.clone(), ty))
3435
}
3536
}
3637
}

0 commit comments

Comments
 (0)