Snap for 8730993 from a13079c4b215a0549438fe346782e39bab2973c5 to mainline-tzdata3-release

Change-Id: Ie0d27973741b1f64ef0006699388166f300717fd
diff --git a/Android.bp b/Android.bp
index 8eacade..0dfc4bc 100644
--- a/Android.bp
+++ b/Android.bp
@@ -42,8 +42,6 @@
     name: "liblibm",
     host_supported: true,
     crate_name: "libm",
-    cargo_env_compat: true,
-    cargo_pkg_version: "0.2.1",
     srcs: ["src/lib.rs"],
     edition: "2018",
     features: ["default"],
@@ -54,19 +52,33 @@
     min_sdk_version: "29",
 }
 
-rust_test {
-    name: "libm_test_src_lib",
-    host_supported: true,
+rust_defaults {
+    name: "libm_defaults",
     crate_name: "libm",
-    cargo_env_compat: true,
-    cargo_pkg_version: "0.2.1",
     srcs: ["src/lib.rs"],
     test_suites: ["general-tests"],
     auto_gen_config: true,
-    test_options: {
-        unit_test: true,
-    },
     edition: "2018",
     features: ["default"],
     proc_macros: ["libno_panic"],
 }
+
+rust_test_host {
+    name: "libm_host_test_src_lib",
+    defaults: ["libm_defaults"],
+    test_options: {
+        unit_test: true,
+    },
+}
+
+rust_test {
+    name: "libm_device_test_src_lib",
+    defaults: ["libm_defaults"],
+}
+
+// dependent_library ["feature_list"]
+//   no-panic-0.1.15
+//   proc-macro2-1.0.26 "default,proc-macro"
+//   quote-1.0.9 "default,proc-macro"
+//   syn-1.0.70 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote"
+//   unicode-xid-0.2.1 "default"
diff --git a/TEST_MAPPING b/TEST_MAPPING
index bfdf123..06d8e5a 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,24 +1,8 @@
-// Generated by update_crate_tests.py for tests that depend on this crate.
+// Generated by cargo2android.py for tests in Android.bp
 {
-  "imports": [
-    {
-      "path": "external/rust/crates/quiche"
-    }
-  ],
   "presubmit": [
     {
-      "name": "doh_unit_test"
-    },
-    {
-      "name": "libm_test_src_lib"
-    }
-  ],
-  "presubmit-rust": [
-    {
-      "name": "doh_unit_test"
-    },
-    {
-      "name": "libm_test_src_lib"
+      "name": "libm_device_test_src_lib"
     }
   ]
 }
diff --git a/patches/test_build_fix.patch b/patches/test_build_fix.patch
deleted file mode 100644
index 82c3756..0000000
--- a/patches/test_build_fix.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From c18c704856ffa8b3349401300e66796d4cc8d4f5 Mon Sep 17 00:00:00 2001
-From: Jethro Beekman <jethro@fortanix.com>
-Date: Thu, 24 Jun 2021 15:58:36 +0200
-Subject: [PATCH] Fix build failure with latest nightly
-
----
- src/math/pow.rs | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/math/pow.rs b/src/math/pow.rs
-index c7fd0df..f79680a 100644
---- a/src/math/pow.rs
-+++ b/src/math/pow.rs
-@@ -604,7 +604,7 @@ mod tests {
- 
-         // Factoring -1 out:
-         // (negative anything ^ integer should be (-1 ^ integer) * (positive anything ^ integer))
--        &[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS]
-+        (&[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS])
-             .iter()
-             .for_each(|int_set| {
-                 int_set.iter().for_each(|int| {
-@@ -616,7 +616,7 @@ mod tests {
- 
-         // Negative base (imaginary results):
-         // (-anything except 0 and Infinity ^ non-integer should be NAN)
--        &NEG[1..(NEG.len() - 1)].iter().for_each(|set| {
-+        (&NEG[1..(NEG.len() - 1)]).iter().for_each(|set| {
-             set.iter().for_each(|val| {
-                 test_sets(&ALL[3..7], &|v: f64| pow(*val, v), &|_| NAN);
-             })
diff --git a/src/math/pow.rs b/src/math/pow.rs
index 8b5989c..ce8e83e 100644
--- a/src/math/pow.rs
+++ b/src/math/pow.rs
@@ -604,7 +604,7 @@
 
         // Factoring -1 out:
         // (negative anything ^ integer should be (-1 ^ integer) * (positive anything ^ integer))
-        (&[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS])
+        &[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS]
             .iter()
             .for_each(|int_set| {
                 int_set.iter().for_each(|int| {
@@ -616,7 +616,7 @@
 
         // Negative base (imaginary results):
         // (-anything except 0 and Infinity ^ non-integer should be NAN)
-        (&NEG[1..(NEG.len() - 1)]).iter().for_each(|set| {
+        &NEG[1..(NEG.len() - 1)].iter().for_each(|set| {
             set.iter().for_each(|val| {
                 test_sets(&ALL[3..7], &|v: f64| pow(*val, v), &|_| NAN);
             })