diff options
| author | Ben Lewis <benlewisj@gmail.com> | 2020-02-15 17:43:14 +1300 |
|---|---|---|
| committer | Ben Lewis <benlewisj@gmail.com> | 2020-02-15 17:43:14 +1300 |
| commit | 821f4a9dfb38dab30df861d3c19788b2e7ed0d95 (patch) | |
| tree | 8f450d5bd526e3a19610ed6014da1f41782b96be | |
| parent | 99a864be39d551362bc29bb76ac06d639afedb42 (diff) | |
| download | rust-821f4a9dfb38dab30df861d3c19788b2e7ed0d95.tar.gz rust-821f4a9dfb38dab30df861d3c19788b2e7ed0d95.zip | |
Monomorphize const type during codegen.
| -rw-r--r-- | src/librustc_codegen_ssa/mir/constant.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_codegen_ssa/mir/constant.rs b/src/librustc_codegen_ssa/mir/constant.rs index 8722aacca72..3bd1755927b 100644 --- a/src/librustc_codegen_ssa/mir/constant.rs +++ b/src/librustc_codegen_ssa/mir/constant.rs @@ -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)) } } } |
