diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:05:46 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:05:46 +0000 |
commit | 4320a2e771d724c370893216a5f8c2f90e49cc46 (patch) | |
tree | 0fa0dd870fdbc21bd918827662c51f21d354dda2 | |
parent | 03fd7e073531635158a0314733efc86917451068 (diff) | |
parent | 584bc1b0b6b3e35c21b1806dd4eb4b3735bc7465 (diff) | |
download | pin-project-internal-4320a2e771d724c370893216a5f8c2f90e49cc46.tar.gz |
Snap for 10453563 from 584bc1b0b6b3e35c21b1806dd4eb4b3735bc7465 to mainline-neuralnetworks-releaseaml_neu_341510000aml_neu_341010080aml_neu_341010000
Change-Id: I3bb2f09201bf72550dc7cfbddd498a63c9ea3f02
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | Cargo.toml | 25 | ||||
-rw-r--r-- | Cargo.toml.orig | 3 | ||||
-rw-r--r-- | METADATA | 12 | ||||
-rw-r--r-- | TEST_MAPPING | 11 | ||||
-rw-r--r-- | src/lib.rs | 12 | ||||
-rw-r--r-- | src/pin_project/attribute.rs | 2 | ||||
-rw-r--r-- | src/pin_project/derive.rs | 17 |
9 files changed, 65 insertions, 23 deletions
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 @@ -43,7 +43,7 @@ rust_proc_macro { 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 @@ rust_proc_macro { "libquote", "libsyn", ], + product_available: true, + vendor_available: true, } @@ -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 @@ version = "1" [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"] @@ -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 @@ third_party { } 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" + } + ] +} @@ -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 @@ impl Parse for Input { 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 @@ fn global_allowed_lints() -> TokenStream { #[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 @@ fn visit_variants<'a>(cx: &mut Context<'a>, variants: &'a Variants) -> Result<Pr 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 @@ fn make_proj_impl( 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 @@ fn make_proj_impl( } }); 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 @@ fn make_proj_impl( 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 @@ fn ensure_not_packed(orig: &OriginalType<'_>, fields: Option<&Fields>) -> Result // 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 // |