]> git.lizzy.rs Git - rust.git/commitdiff
Simplify Misc casts (still incorrect).
authorScott Olson <scott@solson.me>
Sat, 19 Mar 2016 17:07:19 +0000 (11:07 -0600)
committerScott Olson <scott@solson.me>
Sat, 19 Mar 2016 17:07:19 +0000 (11:07 -0600)
src/interpreter.rs

index 3f710ba2e2b23cdb0193189b54fe58864f9ce9d1..e24489931886039b296db77041814fcfd4910855 100644 (file)
@@ -536,14 +536,10 @@ fn pointee_type<'tcx>(ptr_ty: ty::Ty<'tcx>) -> Option<ty::Ty<'tcx>> {
                     }
 
                     Misc => {
-                        if pointee_type(src_ty).is_some() && pointee_type(dest_ty).is_some() {
-                            // FIXME(tsion): Wrong for fat pointers.
-                            self.memory.copy(src, dest, 8)
-                        } else {
-                            // FIXME(tsion): Wrong for almost everything.
-                            self.memory.copy(src, dest, 8)
-                            // panic!("can't handle cast: {:?}", rvalue);
-                        }
+                        // FIXME(tsion): Wrong for almost everything.
+                        let size = dest_repr.size();
+                        self.memory.copy(src, dest, size)
+                        // panic!("can't handle cast: {:?}", rvalue);
                     }
 
                     _ => panic!("can't handle cast: {:?}", rvalue),