Update to zerocopy 0.8.

Bug: 372549215
Test: m vfio_handler pvmfw virtmgr apkdmverity libdm_rust.test
Change-Id: I81f6aea8bf984c0506c6f6b0754b6addc59fc3ca

diff --git a/libs/devicemapper/Android.bp b/libs/devicemapper/Android.bp
index 17727f1..5332469 100644
--- a/libs/devicemapper/Android.bp
+++ b/libs/devicemapper/Android.bp
@@ -16,7 +16,7 @@
         "libhex",
         "libnix",
         "libuuid",
-        "libzerocopy-0.7.35",
+        "libzerocopy",
     ],
     multilib: {
         lib32: {
diff --git a/libs/devicemapper/src/crypt.rs b/libs/devicemapper/src/crypt.rs
index 3afd374..75417ed 100644
--- a/libs/devicemapper/src/crypt.rs
+++ b/libs/devicemapper/src/crypt.rs
@@ -23,7 +23,7 @@
 use std::io::Write;
 use std::mem::size_of;
 use std::path::Path;
-use zerocopy::AsBytes;
+use zerocopy::IntoBytes;
 
 const SECTOR_SIZE: u64 = 512;
 
diff --git a/libs/devicemapper/src/lib.rs b/libs/devicemapper/src/lib.rs
index 5656743..a8f3049 100644
--- a/libs/devicemapper/src/lib.rs
+++ b/libs/devicemapper/src/lib.rs
@@ -37,8 +37,9 @@
 use std::mem::size_of;
 use std::os::unix::io::AsRawFd;
 use std::path::{Path, PathBuf};
-use zerocopy::AsBytes;
-use zerocopy::FromZeroes;
+use zerocopy::FromZeros;
+use zerocopy::Immutable;
+use zerocopy::IntoBytes;
 
 /// Exposes DmCryptTarget & related builder
 pub mod crypt;
@@ -88,7 +89,7 @@
 // `DmTargetSpec` is the header of the data structure for a device-mapper target. When doing the
 // ioctl, one of more `DmTargetSpec` (and its body) are appened to the `DmIoctl` struct.
 #[repr(C)]
-#[derive(Copy, Clone, AsBytes, FromZeroes)]
+#[derive(Copy, Clone, Immutable, IntoBytes, FromZeros)]
 struct DmTargetSpec {
     sector_start: u64,
     length: u64, // number of 512 sectors
diff --git a/libs/devicemapper/src/loopdevice.rs b/libs/devicemapper/src/loopdevice.rs
index 9dc722b..113a946 100644
--- a/libs/devicemapper/src/loopdevice.rs
+++ b/libs/devicemapper/src/loopdevice.rs
@@ -32,7 +32,7 @@
 use std::path::{Path, PathBuf};
 use std::thread;
 use std::time::{Duration, Instant};
-use zerocopy::FromZeroes;
+use zerocopy::FromZeros;
 
 use crate::loopdevice::sys::*;
 
@@ -184,7 +184,7 @@
         let a_file = a_dir.path().join("test");
         let a_size = 4096u64;
         create_empty_file(&a_file, a_size);
-        let dev = attach(a_file, 0, a_size, /*direct_io*/ true, /*writable*/ false).unwrap();
+        let dev = attach(a_file, 0, a_size, /* direct_io */ true, /* writable */ false).unwrap();
         scopeguard::defer! {
             detach(&dev).unwrap();
         }
@@ -197,7 +197,7 @@
         let a_file = a_dir.path().join("test");
         let a_size = 4096u64;
         create_empty_file(&a_file, a_size);
-        let dev = attach(a_file, 0, a_size, /*direct_io*/ false, /*writable*/ false).unwrap();
+        let dev = attach(a_file, 0, a_size, /* direct_io */ false, /* writable */ false).unwrap();
         scopeguard::defer! {
             detach(&dev).unwrap();
         }
@@ -210,7 +210,7 @@
         let a_file = a_dir.path().join("test");
         let a_size = 4096u64;
         create_empty_file(&a_file, a_size);
-        let dev = attach(a_file, 0, a_size, /*direct_io*/ true, /*writable*/ true).unwrap();
+        let dev = attach(a_file, 0, a_size, /* direct_io */ true, /* writable */ true).unwrap();
         scopeguard::defer! {
             detach(&dev).unwrap();
         }
diff --git a/libs/devicemapper/src/loopdevice/sys.rs b/libs/devicemapper/src/loopdevice/sys.rs
index ce4ef61..47d2c08 100644
--- a/libs/devicemapper/src/loopdevice/sys.rs
+++ b/libs/devicemapper/src/loopdevice/sys.rs
@@ -15,7 +15,7 @@
  */
 
 use bitflags::bitflags;
-use zerocopy::FromZeroes;
+use zerocopy::FromZeros;
 
 // This UAPI is copied and converted from include/uapi/linux/loop.h Note that this module doesn't
 // implement all the features introduced in loop(4). Only the features that are required to support
@@ -28,7 +28,7 @@
 pub const LOOP_CLR_FD: libc::c_ulong = 0x4C01;
 
 #[repr(C)]
-#[derive(Copy, Clone, FromZeroes)]
+#[derive(Copy, Clone, FromZeros)]
 pub struct loop_config {
     pub fd: u32,
     pub block_size: u32,
@@ -37,7 +37,7 @@
 }
 
 #[repr(C)]
-#[derive(Copy, Clone, FromZeroes)]
+#[derive(Copy, Clone, FromZeros)]
 pub struct loop_info64 {
     pub lo_device: u64,
     pub lo_inode: u64,
@@ -55,7 +55,7 @@
 }
 
 #[repr(transparent)]
-#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, FromZeroes)]
+#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, FromZeros)]
 pub struct Flag(u32);
 
 bitflags! {
diff --git a/libs/devicemapper/src/sys.rs b/libs/devicemapper/src/sys.rs
index bd1e165..bbf7e45 100644
--- a/libs/devicemapper/src/sys.rs
+++ b/libs/devicemapper/src/sys.rs
@@ -15,8 +15,9 @@
  */
 
 use bitflags::bitflags;
-use zerocopy::AsBytes;
-use zerocopy::FromZeroes;
+use zerocopy::FromZeros;
+use zerocopy::Immutable;
+use zerocopy::IntoBytes;
 
 // UAPI for device mapper can be found at include/uapi/linux/dm-ioctl.h
 
@@ -45,7 +46,7 @@
 }
 
 #[repr(C)]
-#[derive(Copy, Clone, AsBytes, FromZeroes)]
+#[derive(Copy, Clone, Immutable, IntoBytes, FromZeros)]
 pub struct DmIoctl {
     pub version: [u32; 3],
     pub data_size: u32,
@@ -70,7 +71,9 @@
 pub const DM_MAX_TYPE_NAME: usize = 16;
 
 #[repr(transparent)]
-#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, AsBytes, FromZeroes)]
+#[derive(
+    Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Immutable, IntoBytes, FromZeros,
+)]
 pub struct Flag(u32);
 
 bitflags! {
diff --git a/libs/devicemapper/src/verity.rs b/libs/devicemapper/src/verity.rs
index eb342a8..09087da 100644
--- a/libs/devicemapper/src/verity.rs
+++ b/libs/devicemapper/src/verity.rs
@@ -22,7 +22,7 @@
 use std::io::Write;
 use std::mem::size_of;
 use std::path::Path;
-use zerocopy::AsBytes;
+use zerocopy::IntoBytes;
 
 use crate::DmTargetSpec;
 
diff --git a/libs/libfdt/Android.bp b/libs/libfdt/Android.bp
index 1e24ff4..09f288d 100644
--- a/libs/libfdt/Android.bp
+++ b/libs/libfdt/Android.bp
@@ -38,7 +38,7 @@
         "libcstr",
         "liblibfdt_bindgen",
         "libstatic_assertions",
-        "libzerocopy-0.7.35_nostd",
+        "libzerocopy_nostd",
     ],
 }
 
diff --git a/libs/libfdt/src/lib.rs b/libs/libfdt/src/lib.rs
index 5883567..c969749 100644
--- a/libs/libfdt/src/lib.rs
+++ b/libs/libfdt/src/lib.rs
@@ -33,7 +33,7 @@
 use core::ops::Range;
 use cstr::cstr;
 use libfdt::get_slice_at_ptr;
-use zerocopy::AsBytes as _;
+use zerocopy::IntoBytes as _;
 
 use crate::libfdt::{Libfdt, LibfdtMut};
 
diff --git a/libs/libfdt/src/safe_types.rs b/libs/libfdt/src/safe_types.rs
index 03b5bc2..0e79a42 100644
--- a/libs/libfdt/src/safe_types.rs
+++ b/libs/libfdt/src/safe_types.rs
@@ -21,7 +21,7 @@
 use crate::{FdtError, Result};
 
 use zerocopy::byteorder::big_endian;
-use zerocopy::{FromBytes, FromZeroes};
+use zerocopy::FromBytes;
 
 macro_rules! assert_offset_eq {
     // TODO(const_feature(assert_eq)): assert_eq!()
@@ -32,7 +32,7 @@
 
 /// Thin wrapper around `libfdt_bindgen::fdt_header` for transparent endianness handling.
 #[repr(C)]
-#[derive(Debug, FromZeroes, FromBytes)]
+#[derive(Debug, FromBytes)]
 pub struct FdtHeader {
     /// magic word FDT_MAGIC
     pub magic: big_endian::U32,
diff --git a/libs/libvmbase/Android.bp b/libs/libvmbase/Android.bp
index 7bcdc1d..3088633 100644
--- a/libs/libvmbase/Android.bp
+++ b/libs/libvmbase/Android.bp
@@ -91,7 +91,7 @@
         "libtinyvec_nostd",
         "libuuid_nostd",
         "libvirtio_drivers",
-        "libzerocopy-0.7.35_nostd",
+        "libzerocopy_nostd",
         "libzeroize_nostd",
     ],
     whole_static_libs: [
diff --git a/libs/libvmbase/src/rand.rs b/libs/libvmbase/src/rand.rs
index b31bd4b..16c7b6a 100644
--- a/libs/libvmbase/src/rand.rs
+++ b/libs/libvmbase/src/rand.rs
@@ -18,7 +18,7 @@
 use core::fmt;
 use core::mem::size_of;
 use smccc::{self, Hvc};
-use zerocopy::AsBytes as _;
+use zerocopy::IntoBytes as _;
 
 type Entropy = [u8; size_of::<u64>() * 3];