Snap for 10453563 from 584bc1b0b6b3e35c21b1806dd4eb4b3735bc7465 to mainline-os-statsd-release

Change-Id: I9da5b3ff52126438a8423525e70977332240cdd4
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 60d79af..beae06c 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
 {
   "git": {
-    "sha1": "0273e6ecd64057f47c3b2ada6fb4e5c37357c185"
+    "sha1": "d1c11dc50f88330cfb05ac55aaa06c28877eb1d6"
   },
   "path_in_vcs": "pin-project-internal"
 }
\ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 8a0e560..b2629fb 100644
--- a/Android.bp
+++ b/Android.bp
@@ -43,7 +43,7 @@
     name: "libpin_project_internal",
     crate_name: "pin_project_internal",
     cargo_env_compat: true,
-    cargo_pkg_version: "1.0.10",
+    cargo_pkg_version: "1.0.12",
     srcs: ["src/lib.rs"],
     edition: "2018",
     rustlibs: [
@@ -51,4 +51,6 @@
         "libquote",
         "libsyn",
     ],
+    product_available: true,
+    vendor_available: true,
 }
diff --git a/Cargo.toml b/Cargo.toml
index 1d5cfef..b2f5450 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,18 +11,30 @@
 
 [package]
 edition = "2018"
+rust-version = "1.37"
 name = "pin-project-internal"
-version = "1.0.10"
-description = "Implementation detail of the `pin-project` crate.\n"
-keywords = ["pin", "macros", "attribute"]
-categories = ["no-std", "rust-patterns"]
+version = "1.0.12"
+description = """
+Implementation detail of the `pin-project` crate.
+"""
+keywords = [
+    "pin",
+    "macros",
+    "attribute",
+]
+categories = [
+    "no-std",
+    "rust-patterns",
+]
 license = "Apache-2.0 OR MIT"
 repository = "https://github.com/taiki-e/pin-project"
+
 [package.metadata.docs.rs]
 targets = ["x86_64-unknown-linux-gnu"]
 
 [lib]
 proc-macro = true
+
 [dependencies.proc-macro2]
 version = "1"
 
@@ -31,6 +43,9 @@
 
 [dependencies.syn]
 version = "1.0.56"
-features = ["full", "visit-mut"]
+features = [
+    "full",
+    "visit-mut",
+]
 
 [dev-dependencies]
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 78c2f44..8529e36 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,7 +1,8 @@
 [package]
 name = "pin-project-internal"
-version = "1.0.10"
+version = "1.0.12"
 edition = "2018"
+rust-version = "1.37"
 license = "Apache-2.0 OR MIT"
 repository = "https://github.com/taiki-e/pin-project"
 keywords = ["pin", "macros", "attribute"]
diff --git a/METADATA b/METADATA
index caa1eef..3bf60ee 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/pin-project-internal
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
 name: "pin-project-internal"
 description: "Implementation detail of the `pin-project` crate."
 third_party {
@@ -7,13 +11,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/pin-project-internal/pin-project-internal-1.0.10.crate"
+    value: "https://static.crates.io/crates/pin-project-internal/pin-project-internal-1.0.12.crate"
   }
-  version: "1.0.10"
+  version: "1.0.12"
   license_type: NOTICE
   last_upgrade_date {
     year: 2022
-    month: 3
-    day: 1
+    month: 12
+    day: 13
   }
 }
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..664c4df
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,11 @@
+// Generated by update_crate_tests.py for tests that depend on this crate.
+{
+  "imports": [
+    {
+      "path": "external/rust/crates/futures-channel"
+    },
+    {
+      "path": "external/rust/crates/futures-test"
+    }
+  ]
+}
diff --git a/src/lib.rs b/src/lib.rs
index 04c4ce2..07683c4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,10 +7,16 @@
         allow(dead_code, unused_variables)
     )
 ))]
-#![warn(unsafe_code)]
+#![forbid(unsafe_code)]
 #![warn(rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
-#![warn(clippy::default_trait_access, clippy::wildcard_imports)]
-#![allow(clippy::needless_doctest_main)]
+#![warn(clippy::pedantic)]
+#![allow(
+    clippy::needless_doctest_main,
+    clippy::similar_names,
+    clippy::single_match_else,
+    clippy::too_many_lines,
+    clippy::unnested_or_patterns
+)]
 
 // older compilers require explicit `extern crate`.
 #[allow(unused_extern_crates)]
diff --git a/src/pin_project/attribute.rs b/src/pin_project/attribute.rs
index c8811cb..7adfc07 100644
--- a/src/pin_project/attribute.rs
+++ b/src/pin_project/attribute.rs
@@ -47,7 +47,7 @@
         let attrs = input.call(Attribute::parse_outer)?;
 
         let ahead = input.fork();
-        let _: Visibility = ahead.parse()?;
+        let _vis: Visibility = ahead.parse()?;
         if !ahead.peek(Token![struct]) && !ahead.peek(Token![enum]) {
             // If we check this only on proc-macro-derive, it may generate unhelpful error
             // messages. So it is preferable to be able to detect it here.
diff --git a/src/pin_project/derive.rs b/src/pin_project/derive.rs
index 3e578f7..fd2375d 100644
--- a/src/pin_project/derive.rs
+++ b/src/pin_project/derive.rs
@@ -108,6 +108,7 @@
         #[allow(explicit_outlives_requirements)] // https://github.com/rust-lang/rust/issues/60993
         #[allow(single_use_lifetimes)] // https://github.com/rust-lang/rust/issues/55058
         #[allow(unreachable_pub)] // This lint warns `pub` field in private struct.
+        #[allow(unused_tuple_struct_fields)]
         // This lint warns of `clippy::*` generated by external macros.
         // We allow this lint for compatibility with older compilers.
         #[allow(clippy::unknown_clippy_lints)]
@@ -514,7 +515,7 @@
             Fields::Unnamed(_) => visit_fields(cx, Some(ident), fields, Delimiter::Parenthesis)?,
             Fields::Unit => ProjectedFields {
                 proj_own_body: proj_own_body(cx, Some(ident), None, &[]),
-                ..ProjectedFields::default()
+                ..Default::default()
             },
         };
 
@@ -933,8 +934,14 @@
     let orig_ty_generics = cx.orig.generics.split_for_impl().1;
     let proj_ty_generics = cx.proj.generics.split_for_impl().1;
     let (impl_generics, ty_generics, where_clause) = cx.orig.generics.split_for_impl();
+    // TODO: For enums and project_replace, dead_code warnings should not be
+    // allowed because methods are not generated unless explicitly specified.
+    // However, there is currently no good way to allow warnings for generated
+    // code, so we allow warnings for all methods for now.
+    let allow_dead_code = quote! { #[allow(dead_code)] };
 
     let mut project = Some(quote! {
+        #allow_dead_code
         #vis fn project<#lifetime>(
             self: _pin_project::__private::Pin<&#lifetime mut Self>,
         ) -> #proj_ident #proj_ty_generics {
@@ -944,6 +951,7 @@
         }
     });
     let mut project_ref = Some(quote! {
+        #allow_dead_code
         #[allow(clippy::missing_const_for_fn)]
         #vis fn project_ref<#lifetime>(
             self: _pin_project::__private::Pin<&#lifetime Self>,
@@ -956,6 +964,7 @@
     let mut project_replace = cx.project_replace.span().map(|span| {
         // It is enough to only set the span of the signature.
         let sig = quote_spanned! { span =>
+            #allow_dead_code
             #vis fn project_replace(
                 self: _pin_project::__private::Pin<&mut Self>,
                 __replacement: Self,
@@ -1084,12 +1093,6 @@
     // See also https://github.com/taiki-e/pin-project/pull/34.
     //
     // Note:
-    // - pin-project v0.4.3 or later (#135, v0.4.0-v0.4.2 are already yanked for
-    //   another reason) is internally proc-macro-derive, so they are not
-    //   affected by the problem that the struct definition is rewritten by
-    //   another macro after the #[pin_project] is expanded.
-    //   So this is probably no longer necessary, but it keeps it for now.
-    //
     // - Lint-based tricks aren't perfect, but they're much better than nothing:
     //   https://github.com/taiki-e/pin-project-lite/issues/26
     //