- // get the fat ptr, and recursively check it
- let ptr = self.ref_to_mplace(self.read_value(dest.into())?)?;
- assert_eq!(ptr.extra, PlaceExtra::Vtable(vtable));
- let unpacked_ptr = self.unpack_unsized_mplace(ptr)?;
- if seen.insert(unpacked_ptr) {
- todo.push((unpacked_ptr, path_clone_and_deref(path)));
+ // for safe ptrs, get the fat ptr, and recursively check it
+ if !dest.layout.ty.is_unsafe_ptr() {
+ let ptr = self.ref_to_mplace(self.read_value(dest.into())?)?;
+ assert_eq!(ptr.extra, PlaceExtra::Vtable(vtable));
+ let unpacked_ptr = self.unpack_unsized_mplace(ptr)?;
+ if seen.insert(unpacked_ptr) {
+ todo.push((unpacked_ptr, path_clone_and_deref(path)));
+ }
+ // FIXME: More checks for the vtable... making sure it is exactly
+ // the one one would expect for this type.