summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-08-11 15:11:39 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-08-11 15:11:39 +0000
commite8adb29cb4721b39600cb5fd104298f23d11393e (patch)
tree9b6e6633ecc2299c1a0d601f3989284f73b8659f
parent5d04f27aa04e3fbfee2e4a831944dc04814a897d (diff)
parentba297fb2ecf683b3e7ef61b2c491b4f7b4388cf6 (diff)
downloadpin-project-internal-e8adb29cb4721b39600cb5fd104298f23d11393e.tar.gz
Upgrade rust/crates/pin-project-internal to 1.0.8 am: 390cfc29ad am: 3d23b9a9a9 am: 3536cb78bf am: ba297fb2ec
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project-internal/+/1791069 Change-Id: Iaae65038276659b07408e22392201f3a2ffe4cfc
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp4
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA8
-rw-r--r--src/lib.rs2
-rw-r--r--src/pin_project/derive.rs28
-rw-r--r--src/utils.rs4
8 files changed, 28 insertions, 24 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 51b8b66..759ab72 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "c110ce7bc8ad8473c735f8a2f8b4ca0f8bd4b315"
+ "sha1": "6bd40906acb8574a3a0bbadc7cf1349fadac7d3c"
}
}
diff --git a/Android.bp b/Android.bp
index 7dfb19c..f9fca18 100644
--- a/Android.bp
+++ b/Android.bp
@@ -69,7 +69,7 @@ rust_test_host {
}
// dependent_library ["feature_list"]
-// proc-macro2-1.0.26 "default,proc-macro"
+// proc-macro2-1.0.28 "default,proc-macro"
// quote-1.0.9 "default,proc-macro"
-// syn-1.0.72 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit-mut"
+// syn-1.0.74 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit-mut"
// unicode-xid-0.2.2 "default"
diff --git a/Cargo.toml b/Cargo.toml
index 35aa262..ace11fe 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "pin-project-internal"
-version = "1.0.7"
+version = "1.0.8"
authors = ["Taiki Endo <te316e89@gmail.com>"]
description = "Implementation detail of the `pin-project` crate.\n"
documentation = "https://docs.rs/pin-project-internal"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 71fc35a..3d0c564 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "pin-project-internal"
-version = "1.0.7"
+version = "1.0.8"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2018"
license = "Apache-2.0 OR MIT"
diff --git a/METADATA b/METADATA
index 5581c75..5dd40df 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/pin-project-internal/pin-project-internal-1.0.7.crate"
+ value: "https://static.crates.io/crates/pin-project-internal/pin-project-internal-1.0.8.crate"
}
- version: "1.0.7"
+ version: "1.0.8"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 5
- day: 19
+ month: 8
+ day: 9
}
}
diff --git a/src/lib.rs b/src/lib.rs
index d14228d..9bfccc0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -9,7 +9,7 @@
))]
#![warn(unsafe_code)]
#![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
-#![warn(clippy::default_trait_access)]
+#![warn(clippy::default_trait_access, clippy::wildcard_imports)]
#![allow(clippy::needless_doctest_main)]
// older compilers require explicit `extern crate`.
diff --git a/src/pin_project/derive.rs b/src/pin_project/derive.rs
index 7dc1ba5..47c061f 100644
--- a/src/pin_project/derive.rs
+++ b/src/pin_project/derive.rs
@@ -88,6 +88,7 @@ impl GenerateTokens {
// * https://github.com/taiki-e/pin-project/pull/70
#allowed_lints
#[allow(clippy::semicolon_if_nothing_returned)]
+ #[allow(clippy::use_self)]
#[allow(clippy::used_underscore_binding)]
const _: () = {
#scoped
@@ -112,12 +113,13 @@ fn global_allowed_lints() -> TokenStream {
#[allow(clippy::unknown_clippy_lints)]
#[allow(clippy::pattern_type_mismatch)]
#[allow(clippy::redundant_pub_crate)] // This lint warns `pub(crate)` field in private struct.
+ #[allow(clippy::type_repetition_in_bounds)] // https://github.com/rust-lang/rust-clippy/issues/4326
}
}
/// Returns attributes used on projected types.
-fn proj_allowed_lints(kind: TypeKind) -> (TokenStream, TokenStream, TokenStream) {
- let large_enum_variant = if kind == Enum {
+fn proj_allowed_lints(cx: &Context<'_>) -> (TokenStream, TokenStream, TokenStream) {
+ let large_enum_variant = if cx.kind == Enum {
Some(quote! {
#[allow(variant_size_differences)]
#[allow(clippy::large_enum_variant)]
@@ -126,20 +128,22 @@ fn proj_allowed_lints(kind: TypeKind) -> (TokenStream, TokenStream, TokenStream)
None
};
let global_allowed_lints = global_allowed_lints();
+ let proj_mut_allowed_lints = if cx.project { Some(&global_allowed_lints) } else { None };
let proj_mut = quote! {
- #global_allowed_lints
+ #proj_mut_allowed_lints
#[allow(dead_code)] // This lint warns unused fields/variants.
#[allow(clippy::mut_mut)] // This lint warns `&mut &mut <ty>`.
- #[allow(clippy::type_repetition_in_bounds)] // https://github.com/rust-lang/rust-clippy/issues/4326}
};
+ let proj_ref_allowed_lints = if cx.project_ref { Some(&global_allowed_lints) } else { None };
let proj_ref = quote! {
- #global_allowed_lints
+ #proj_ref_allowed_lints
#[allow(dead_code)] // This lint warns unused fields/variants.
#[allow(clippy::ref_option_ref)] // This lint warns `&Option<&<ty>>`.
- #[allow(clippy::type_repetition_in_bounds)] // https://github.com/rust-lang/rust-clippy/issues/4326
};
+ let proj_own_allowed_lints =
+ if cx.project_replace.ident().is_some() { Some(&global_allowed_lints) } else { None };
let proj_own = quote! {
- #global_allowed_lints
+ #proj_own_allowed_lints
#[allow(dead_code)] // This lint warns unused fields/variants.
#large_enum_variant
};
@@ -368,7 +372,7 @@ fn parse_struct<'a>(
Fields::Unit => unreachable!(),
};
- let (proj_attrs, proj_ref_attrs, proj_own_attrs) = proj_allowed_lints(cx.kind);
+ let (proj_attrs, proj_ref_attrs, proj_own_attrs) = proj_allowed_lints(cx);
generate.extend(cx.project, quote! {
#proj_attrs
#vis struct #proj_ident #proj_generics #where_clause_fields
@@ -441,7 +445,7 @@ fn parse_enum<'a>(
let proj_generics = &cx.proj.generics;
let proj_where_clause = &cx.proj.where_clause;
- let (proj_attrs, proj_ref_attrs, proj_own_attrs) = proj_allowed_lints(cx.kind);
+ let (proj_attrs, proj_ref_attrs, proj_own_attrs) = proj_allowed_lints(cx);
if cx.project {
generate.extend(true, quote! {
#proj_attrs
@@ -611,7 +615,7 @@ fn visit_fields<'a>(
let proj_own_fields = surround(delim, proj_own_fields);
let proj_move = Group::new(delim, proj_move);
- let proj_own_body = proj_own_body(cx, variant_ident, Some(proj_move), &pinned_bindings);
+ let proj_own_body = proj_own_body(cx, variant_ident, Some(&proj_move), &pinned_bindings);
Ok(ProjectedFields {
proj_pat,
@@ -629,7 +633,7 @@ fn visit_fields<'a>(
fn proj_own_body(
cx: &Context<'_>,
variant_ident: Option<&Ident>,
- proj_move: Option<Group>,
+ proj_move: Option<&Group>,
pinned_fields: &[Ident],
) -> TokenStream {
let ident = &cx.proj.own_ident;
@@ -889,7 +893,7 @@ fn make_drop_impl(cx: &Context<'_>) -> TokenStream {
// Since the user did not pass `PinnedDrop` to `#[pin_project]`, any `PinnedDrop`
// impl will not actually be called. Unfortunately, we can't detect this situation
// directly from either the `#[pin_project]` or `#[pinned_drop]` attributes, since
- // we don't know what other attirbutes/impl may exist.
+ // we don't know what other attributes/impl may exist.
//
// To ensure that users don't accidentally write a non-functional `PinnedDrop`
// impls, we emit one ourselves. If the user ends up writing a `PinnedDrop` impl,
diff --git a/src/utils.rs b/src/utils.rs
index 2db00e2..3fa07e7 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -261,7 +261,7 @@ impl ReplaceReceiver<'_> {
match iter.peek() {
Some(TokenTree::Punct(p)) if p.as_char() == ':' => {
let span = ident.span();
- out.extend(quote_spanned!(span=> <#self_ty>))
+ out.extend(quote_spanned!(span=> <#self_ty>));
}
_ => out.extend(quote!(#self_ty)),
}
@@ -356,7 +356,7 @@ impl VisitMut for ReplaceReceiver<'_> {
match item {
// Visit `macro_rules!` because locally defined macros can refer to `self`.
Item::Macro(item) if item.mac.path.is_ident("macro_rules") => {
- self.visit_macro_mut(&mut item.mac)
+ self.visit_macro_mut(&mut item.mac);
}
// Otherwise, do not recurse into nested items.
_ => {}