From 1550fd212b2100c875f7fc2ccb9638c7ca7c709b Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 22 May 2018 16:18:43 +0200 Subject: [PATCH] Use the destination type size instead of the source type size --- src/librustc_mir/interpret/cast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/cast.rs b/src/librustc_mir/interpret/cast.rs index a2eede82acd..4efd89d3816 100644 --- a/src/librustc_mir/interpret/cast.rs +++ b/src/librustc_mir/interpret/cast.rs @@ -21,7 +21,7 @@ pub(super) fn cast_primval( Scalar::Bits { defined: 0, .. } => Ok(val), Scalar::Ptr(ptr) => self.cast_from_ptr(ptr, dest_ty), Scalar::Bits { bits, .. } => { - // TODO(oli-obk): impl scalar_size for floats and check defined bits here + // TODO(oli-obk): check defined bits here match src_ty.sty { TyFloat(fty) => self.cast_from_float(bits, fty, dest_ty), _ => self.cast_from_int(bits, src_ty, dest_ty),