]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/interpret/operator.rs
Auto merge of #62322 - wesleywiser:promoted_query, r=oli-obk
[rust.git] / src / librustc_mir / interpret / operator.rs
index e8a691733791a70f9ce17f544110a1e0c2ca7bfb..20180c9cba542423aeaa53acc00b77e23c245692 100644 (file)
@@ -4,10 +4,10 @@
 use rustc_apfloat::Float;
 use rustc::mir::interpret::{InterpResult, Scalar};
 
-use super::{InterpretCx, PlaceTy, Immediate, Machine, ImmTy};
+use super::{InterpCx, PlaceTy, Immediate, Machine, ImmTy};
 
 
-impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpretCx<'mir, 'tcx, M> {
+impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
     /// Applies the binary operation `op` to the two operands and writes a tuple of the result
     /// and a boolean signifying the potential overflow to the destination.
     pub fn binop_with_overflow(
@@ -36,7 +36,7 @@ pub fn binop_ignore_overflow(
     }
 }
 
-impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpretCx<'mir, 'tcx, M> {
+impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
     fn binary_char_op(
         &self,
         bin_op: mir::BinOp,
@@ -347,7 +347,7 @@ pub fn unary_op(
             }
             _ => {
                 assert!(layout.ty.is_integral());
-                let val = val.to_bits(layout.size)?;
+                let val = self.force_bits(val, layout.size)?;
                 let res = match un_op {
                     Not => !val,
                     Neg => {