]> git.lizzy.rs Git - rust.git/commitdiff
Update for changes in rustc master.
authorScott Olson <scott@solson.me>
Tue, 15 Mar 2016 22:09:08 +0000 (16:09 -0600)
committerScott Olson <scott@solson.me>
Tue, 15 Mar 2016 22:09:08 +0000 (16:09 -0600)
src/interpreter.rs

index e725f15df83b925d10bb15672f363d17c9e282f1..7877fbaa4842be9242d5eb5b3225b2c18cc25e88 100644 (file)
@@ -443,16 +443,10 @@ fn const_to_ptr(&mut self, const_val: &const_eval::ConstVal) -> EvalResult<Point
         use rustc::middle::const_eval::ConstVal::*;
         match *const_val {
             Float(_f) => unimplemented!(),
-            Int(n) => {
+            Integral(int) => {
                 // TODO(tsion): Check int constant type.
                 let ptr = self.memory.allocate(8);
-                try!(self.memory.write_i64(ptr, n));
-                Ok(ptr)
-            }
-            Uint(n) => {
-                // TODO(tsion): Check int constant type.
-                let ptr = self.memory.allocate(8);
-                try!(self.memory.write_u64(ptr, n));
+                try!(self.memory.write_u64(ptr, int.to_u64_unchecked()));
                 Ok(ptr)
             }
             Str(ref _s) => unimplemented!(),
@@ -462,11 +456,13 @@ fn const_to_ptr(&mut self, const_val: &const_eval::ConstVal) -> EvalResult<Point
                 try!(self.memory.write_bool(ptr, b));
                 Ok(ptr)
             }
+            Char(_c)          => unimplemented!(),
             Struct(_node_id)  => unimplemented!(),
             Tuple(_node_id)   => unimplemented!(),
             Function(_def_id) => unimplemented!(),
             Array(_, _)       => unimplemented!(),
             Repeat(_, _)      => unimplemented!(),
+            Dummy             => unimplemented!(),
         }
     }