Monomorphize const type during codegen.

This commit is contained in:
Ben Lewis 2020-02-15 17:43:14 +13:00
parent 99a864be39
commit 821f4a9dfb

View File

@ -30,7 +30,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
}
_ => {
let val = self.eval_mir_constant(constant)?;
Ok(OperandRef::from_const(bx, val.clone(), constant.literal.ty))
let ty = self.monomorphize(&constant.literal.ty);
Ok(OperandRef::from_const(bx, val.clone(), ty))
}
}
}