Snap for 9884336 from a8f42ca58cff3c3d04c1abc384494faff0e66353 to udc-d1-release

Change-Id: Iacc5f4af0a26ca3494746374b69ce92d7e8f6083
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 2a2f561..8ba8371 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
 {
   "git": {
-    "sha1": "5e46d483c61cf2ab0a69cc060ea604946b0b28ce"
+    "sha1": "53030865ef42b362cdf21874b69c1ba21cda7b5b"
   },
   "path_in_vcs": "zeroize"
 }
\ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 51189dc..1f468e4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -36,9 +36,9 @@
     host_supported: true,
     crate_name: "zeroize",
     cargo_env_compat: true,
-    cargo_pkg_version: "1.5.7",
+    cargo_pkg_version: "1.6.0",
     srcs: ["src/lib.rs"],
-    edition: "2018",
+    edition: "2021",
     features: [
         "alloc",
         "zeroize_derive",
@@ -58,10 +58,10 @@
     name: "zeroize_test_defaults",
     crate_name: "zeroize",
     cargo_env_compat: true,
-    cargo_pkg_version: "1.5.7",
+    cargo_pkg_version: "1.6.0",
     test_suites: ["general-tests"],
     auto_gen_config: true,
-    edition: "2018",
+    edition: "2021",
     features: [
         "alloc",
         "zeroize_derive",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 83f8958..12fded9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,18 @@
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+## 1.6.0 (2023-03-26)
+### Added
+- Impl `Zeroize` for `core::num::Wrapping` ([#818])
+- Impl `Zeroize` for `str` and `Box<str>` ([#842])
+
+### Changed
+- 2021 edition upgrade; MSRV 1.56 ([#869])
+
+[#818]: https://github.com/RustCrypto/utils/pull/818
+[#842]: https://github.com/RustCrypto/utils/pull/842
+[#869]: https://github.com/RustCrypto/utils/pull/869
+
 ## 1.5.7 (2022-07-20)
 ### Added
 - Optional `serde` support ([#780])
diff --git a/Cargo.toml b/Cargo.toml
index a70f551..636d969 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,9 +10,10 @@
 # See Cargo.toml.orig for the original contents.
 
 [package]
-edition = "2018"
+edition = "2021"
+rust-version = "1.56"
 name = "zeroize"
-version = "1.5.7"
+version = "1.6.0"
 authors = ["The RustCrypto Project Developers"]
 description = """
 Securely clear secrets from memory with a simple trait built on
@@ -37,6 +38,7 @@
 ]
 license = "Apache-2.0 OR MIT"
 repository = "https://github.com/RustCrypto/utils/tree/master/zeroize"
+resolver = "1"
 
 [package.metadata.docs.rs]
 all-features = true
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 3efc8f4..d1bbf81 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,5 +1,6 @@
 [package]
 name = "zeroize"
+version = "1.6.0"
 description = """
 Securely clear secrets from memory with a simple trait built on
 stable Rust primitives which guarantee memory is zeroed using an
@@ -7,14 +8,14 @@
 Uses a portable pure Rust implementation that works everywhere,
 even WASM!
 """
-version = "1.5.7"
 authors = ["The RustCrypto Project Developers"]
 license = "Apache-2.0 OR MIT"
 repository = "https://github.com/RustCrypto/utils/tree/master/zeroize"
 readme = "README.md"
 categories = ["cryptography", "memory-management", "no-std", "os"]
 keywords = ["memory", "memset", "secure", "volatile", "zero"]
-edition = "2018"
+edition = "2021"
+rust-version = "1.56"
 
 [dependencies]
 serde = { version = "1.0", default-features = false, optional = true }
diff --git a/LICENSE-MIT b/LICENSE-MIT
new file mode 100644
index 0000000..3a2b004
--- /dev/null
+++ b/LICENSE-MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018-2021 The RustCrypto Project Developers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/METADATA b/METADATA
index 9f11c02..a43848d 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,7 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update rust/crates/zeroize
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
 name: "zeroize"
 description: "Securely zero memory while avoiding compiler optimizations."
 third_party {
@@ -7,14 +11,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/zeroize/zeroize-1.5.7.crate"
+    value: "https://static.crates.io/crates/zeroize/zeroize-1.6.0.crate"
   }
-  version: "1.5.7"
-  # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same.
+  version: "1.6.0"
   license_type: NOTICE
   last_upgrade_date {
-    year: 2022
-    month: 9
-    day: 6
+    year: 2023
+    month: 3
+    day: 30
   }
 }
diff --git a/README.md b/README.md
index 4f71ab4..0156ac0 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@
 
 ## Minimum Supported Rust Version
 
-Rust **1.51** or newer.
+Rust **1.56** or newer.
 
 In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope
 for this crate's SemVer guarantees), however when we do it will be accompanied by
@@ -64,7 +64,7 @@
 [docs-image]: https://docs.rs/zeroize/badge.svg
 [docs-link]: https://docs.rs/zeroize/
 [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
-[rustc-image]: https://img.shields.io/badge/rustc-1.51+-blue.svg
+[rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg
 [build-image]: https://github.com/RustCrypto/utils/actions/workflows/zeroize.yml/badge.svg
 [build-link]: https://github.com/RustCrypto/utils/actions/workflows/zeroize.yml
 
diff --git a/src/aarch64.rs b/src/aarch64.rs
index fc6c8f2..956f648 100644
--- a/src/aarch64.rs
+++ b/src/aarch64.rs
@@ -1,7 +1,7 @@
 //! [`Zeroize`] impls for ARM64 SIMD registers.
 //!
-//! Support for this is gated behind an `aarch64` feature because
-//! support for `core::arch::aarch64` is currently nightly-only.
+//! Gated behind the `aarch64` feature: MSRV 1.59
+//! (the overall crate is MSRV 1.51)
 
 use crate::{atomic_fence, volatile_write, Zeroize};
 
diff --git a/src/lib.rs b/src/lib.rs
index 9de75bc..1dd35f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -64,7 +64,7 @@
 //!
 //! With the `std` feature enabled (which it is **not** by default), [`Zeroize`]
 //! is also implemented for [`CString`]. After calling `zeroize()` on a `CString`,
-//! it will its internal buffer will contain exactly one nul byte. The backing
+//! its internal buffer will contain exactly one nul byte. The backing
 //! memory is zeroed by converting it to a `Vec<u8>` and back into a `CString`.
 //! (NOTE: see "Stack/Heap Zeroing Notes" for important `Vec`/`String`/`CString` details)
 //!
@@ -258,8 +258,8 @@
     marker::{PhantomData, PhantomPinned},
     mem::{self, MaybeUninit},
     num::{
-        NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128,
-        NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize,
+        self, NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize,
+        NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize,
     },
     ops, ptr,
     slice::IterMut,
@@ -353,6 +353,15 @@
     NonZeroUsize
 );
 
+impl<Z> Zeroize for num::Wrapping<Z>
+where
+    Z: Zeroize,
+{
+    fn zeroize(&mut self) {
+        self.0.zeroize();
+    }
+}
+
 /// Impl [`Zeroize`] on arrays of types that impl [`Zeroize`].
 impl<Z, const N: usize> Zeroize for [Z; N]
 where
@@ -471,6 +480,14 @@
     }
 }
 
+impl Zeroize for str {
+    fn zeroize(&mut self) {
+        // Safety:
+        // A zeroized byte slice is a valid UTF-8 string.
+        unsafe { self.as_bytes_mut().zeroize() }
+    }
+}
+
 /// [`PhantomData`] is always zero sized so provide a [`Zeroize`] implementation.
 impl<Z> Zeroize for PhantomData<Z> {
     fn zeroize(&mut self) {}
@@ -585,6 +602,14 @@
 
 #[cfg(feature = "alloc")]
 #[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
+impl Zeroize for Box<str> {
+    fn zeroize(&mut self) {
+        self.as_mut().zeroize();
+    }
+}
+
+#[cfg(feature = "alloc")]
+#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
 impl Zeroize for String {
     fn zeroize(&mut self) {
         unsafe { self.as_mut_vec() }.zeroize();
diff --git a/tests/zeroize_derive.rs b/tests/zeroize_derive.rs
index 4e0fdc6..96c10c3 100644
--- a/tests/zeroize_derive.rs
+++ b/tests/zeroize_derive.rs
@@ -315,3 +315,13 @@
     }
     assert_eq!(&value.0 .0, &[0, 0, 0])
 }
+
+#[test]
+#[cfg(feature = "alloc")]
+fn derive_zeroize_on_drop_generic() {
+    #[derive(ZeroizeOnDrop)]
+    struct Y<T: Zeroize>(Box<T>);
+
+    #[derive(ZeroizeOnDrop)]
+    struct Z<T: Zeroize>(Vec<T>);
+}