librustc{, codegen_ssa,infer,mir_build}: don't clone types that are copy

This commit is contained in:
Matthias Krüger 2020-02-24 14:48:40 +01:00
parent 5ae4500eff
commit d4a005bd03
6 changed files with 6 additions and 6 deletions

View file

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