summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2023-11-17 19:16:05 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-11-17 19:16:05 +0000
commit4c6c42729b9561218a69add289d87e836a78de78 (patch)
tree5947c77eb0172097e7dc27ca906557c42773d2e2
parent370c8fc045caac3c9f543aefbbfa27f0fc9b487c (diff)
parent58d4ef8e192b7cb81ddcfd1d5d6419eb46e1763f (diff)
downloadpin-project-internal-4c6c42729b9561218a69add289d87e836a78de78.tar.gz
Upgrade pin-project-internal to 1.1.3 am: 7afd7c1671 am: b88ed84f36 am: 58d4ef8e19
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project-internal/+/2828249 Change-Id: I08d4edf7da4f32faee9b8a3e26060d8829557e6f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp4
-rw-r--r--Cargo.toml11
-rw-r--r--Cargo.toml.orig12
-rw-r--r--METADATA12
-rw-r--r--patches/syn-2.diff378
-rw-r--r--src/lib.rs3
-rw-r--r--src/pin_project/args.rs1
-rw-r--r--src/pin_project/attribute.rs1
-rw-r--r--src/pin_project/derive.rs4
-rw-r--r--src/utils.rs2
11 files changed, 27 insertions, 403 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index beae06c..3b7591f 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
{
"git": {
- "sha1": "d1c11dc50f88330cfb05ac55aaa06c28877eb1d6"
+ "sha1": "55829b9ac3a24d25a2b188544943ce880cbfbe4e"
},
"path_in_vcs": "pin-project-internal"
} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 62ee945..364a505 100644
--- a/Android.bp
+++ b/Android.bp
@@ -43,9 +43,9 @@ rust_proc_macro {
name: "libpin_project_internal",
crate_name: "pin_project_internal",
cargo_env_compat: true,
- cargo_pkg_version: "1.0.12",
+ cargo_pkg_version: "1.1.3",
srcs: ["src/lib.rs"],
- edition: "2018",
+ edition: "2021",
rustlibs: [
"libproc_macro2",
"libquote",
diff --git a/Cargo.toml b/Cargo.toml
index b2f5450..1ab542e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,10 +10,10 @@
# See Cargo.toml.orig for the original contents.
[package]
-edition = "2018"
-rust-version = "1.37"
+edition = "2021"
+rust-version = "1.56"
name = "pin-project-internal"
-version = "1.0.12"
+version = "1.1.3"
description = """
Implementation detail of the `pin-project` crate.
"""
@@ -24,6 +24,7 @@ keywords = [
]
categories = [
"no-std",
+ "no-std::no-alloc",
"rust-patterns",
]
license = "Apache-2.0 OR MIT"
@@ -36,13 +37,13 @@ targets = ["x86_64-unknown-linux-gnu"]
proc-macro = true
[dependencies.proc-macro2]
-version = "1"
+version = "1.0.60"
[dependencies.quote]
version = "1"
[dependencies.syn]
-version = "1.0.56"
+version = "2.0.1"
features = [
"full",
"visit-mut",
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 8529e36..dc8f1e4 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,12 +1,12 @@
[package]
name = "pin-project-internal"
-version = "1.0.12"
-edition = "2018"
-rust-version = "1.37"
+version = "1.1.3"
+edition = "2021"
+rust-version = "1.56"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/pin-project"
keywords = ["pin", "macros", "attribute"]
-categories = ["no-std", "rust-patterns"]
+categories = ["no-std", "no-std::no-alloc", "rust-patterns"]
description = """
Implementation detail of the `pin-project` crate.
"""
@@ -18,9 +18,9 @@ targets = ["x86_64-unknown-linux-gnu"]
proc-macro = true
[dependencies]
-proc-macro2 = "1"
+proc-macro2 = "1.0.60"
quote = "1"
-syn = { version = "1.0.56", features = ["full", "visit-mut"] }
+syn = { version = "2.0.1", features = ["full", "visit-mut"] }
[dev-dependencies]
pin-project = { path = ".." }
diff --git a/METADATA b/METADATA
index 3bf60ee..cb08287 100644
--- a/METADATA
+++ b/METADATA
@@ -1,6 +1,6 @@
# 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
+# For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
name: "pin-project-internal"
description: "Implementation detail of the `pin-project` crate."
@@ -11,13 +11,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/pin-project-internal/pin-project-internal-1.0.12.crate"
+ value: "https://static.crates.io/crates/pin-project-internal/pin-project-internal-1.1.3.crate"
}
- version: "1.0.12"
+ version: "1.1.3"
license_type: NOTICE
last_upgrade_date {
- year: 2022
- month: 12
- day: 13
+ year: 2023
+ month: 11
+ day: 14
}
}
diff --git a/patches/syn-2.diff b/patches/syn-2.diff
deleted file mode 100644
index 143c988..0000000
--- a/patches/syn-2.diff
+++ /dev/null
@@ -1,378 +0,0 @@
-diff --git a/src/pin_project/args.rs b/src/pin_project/args.rs
-index d0d4f36..d242ae7 100644
---- a/src/pin_project/args.rs
-+++ b/src/pin_project/args.rs
-@@ -16,10 +16,9 @@ pub(super) fn parse_args(attrs: &[Attribute]) -> Result<Args> {
- impl Parse for Input {
- fn parse(input: ParseStream<'_>) -> Result<Self> {
- Ok(Self((|| {
-- let content = input.parenthesized().ok()?;
-- let private = content.parse::<Ident>().ok()?;
-+ let private = input.parse::<Ident>().ok()?;
- if private == "__private" {
-- content.parenthesized().ok()?.parse::<TokenStream>().ok()
-+ input.parenthesized().ok()?.parse::<TokenStream>().ok()
- } else {
- None
- }
-@@ -31,10 +30,10 @@ pub(super) fn parse_args(attrs: &[Attribute]) -> Result<Args> {
- bail!(attr, "duplicate #[pin_project] attribute");
- }
-
-- let mut attrs = attrs.iter().filter(|attr| attr.path.is_ident(PIN));
-+ let mut attrs = attrs.iter().filter(|attr| attr.path().is_ident(PIN));
-
- let prev = if let Some(attr) = attrs.next() {
-- (attr, syn::parse2::<Input>(attr.tokens.clone()).unwrap().0)
-+ (attr, syn::parse2::<Input>(attr.meta.require_list()?.tokens.clone())?.0)
- } else {
- // This only fails if another macro removes `#[pin]`.
- bail!(TokenStream::new(), "#[pin_project] attribute has been removed");
-@@ -46,7 +45,7 @@ pub(super) fn parse_args(attrs: &[Attribute]) -> Result<Args> {
- // has the same span as `#[pin_project]`, it is possible
- // that a useless error message will be generated.
- // So, use the span of `prev_attr` if it is not a valid attribute.
-- let res = syn::parse2::<Input>(attr.tokens.clone()).unwrap().0;
-+ let res = syn::parse2::<Input>(attr.meta.require_list()?.tokens.clone())?.0;
- let span = match (prev_res, res) {
- (Some(_), _) => attr,
- (None, _) => prev_attr,
-diff --git a/src/pin_project/derive.rs b/src/pin_project/derive.rs
-index fd2375d..d2b2b5e 100644
---- a/src/pin_project/derive.rs
-+++ b/src/pin_project/derive.rs
-@@ -1,9 +1,9 @@
- use proc_macro2::{Delimiter, Group, Span, TokenStream};
- use quote::{format_ident, quote, quote_spanned, ToTokens};
- use syn::{
-- parse_quote, token, visit_mut::VisitMut, Attribute, Data, DataEnum, DeriveInput, Error, Field,
-- Fields, FieldsNamed, FieldsUnnamed, Generics, Ident, Index, Lifetime, LifetimeDef, Meta,
-- MetaList, MetaNameValue, NestedMeta, Result, Token, Type, Variant, Visibility, WhereClause,
-+ parse_quote, punctuated::Punctuated, token, visit_mut::VisitMut, Attribute, Data, DataEnum,
-+ DeriveInput, Error, Field, Fields, FieldsNamed, FieldsUnnamed, Generics, Ident, Index,
-+ Lifetime, LifetimeParam, Meta, Result, Token, Type, Variant, Visibility, WhereClause,
- };
-
- use super::{
-@@ -235,7 +235,7 @@ impl<'a> Context<'a> {
- }
- }
-
--#[derive(Copy, Clone, Eq, PartialEq)]
-+#[derive(Copy, Clone, PartialEq)]
- enum TypeKind {
- Enum,
- Struct,
-@@ -305,7 +305,7 @@ fn validate_struct(ident: &Ident, fields: &Fields) -> Result<()> {
- fn validate_enum(brace_token: token::Brace, variants: &Variants) -> Result<()> {
- if variants.is_empty() {
- return Err(Error::new(
-- brace_token.span,
-+ brace_token.span.join(),
- "#[pin_project] attribute may not be used on enums without variants",
- ));
- }
-@@ -569,7 +569,9 @@ fn visit_fields<'a>(
- let mut proj_move = TokenStream::new();
- let mut pinned_bindings = Vec::with_capacity(fields.len());
-
-- for (i, Field { attrs, vis, ident, colon_token, ty }) in fields.iter().enumerate() {
-+ for (i, Field { attrs, vis, ident, colon_token, ty, mutability: _ }) in
-+ fields.iter().enumerate()
-+ {
- let binding = ident.clone().unwrap_or_else(|| format_ident!("_{}", i));
- proj_pat.extend(quote!(#binding,));
- let lifetime = &cx.proj.lifetime;
-@@ -768,7 +770,7 @@ fn make_unpin_impl(cx: &Context<'_>) -> TokenStream {
- // This ensures that any unused type parameters
- // don't end up with `Unpin` bounds.
- let lifetime_fields = cx.orig.generics.lifetimes().enumerate().map(
-- |(i, LifetimeDef { lifetime, .. })| {
-+ |(i, LifetimeParam { lifetime, .. })| {
- let field_ident = format_ident!("__lifetime{}", i);
- quote!(#field_ident: &#lifetime ())
- },
-@@ -1016,33 +1018,26 @@ fn make_proj_impl(
- /// - Generates a function that borrows fields without an unsafe block and
- /// forbidding `unaligned_references` lint.
- fn ensure_not_packed(orig: &OriginalType<'_>, fields: Option<&Fields>) -> Result<TokenStream> {
-- for meta in orig.attrs.iter().filter_map(|attr| attr.parse_meta().ok()) {
-- if let Meta::List(list) = meta {
-+ for attr in orig.attrs {
-+ if let Meta::List(ref list) = attr.meta {
- if list.path.is_ident("repr") {
-- for repr in list.nested.iter() {
-- match repr {
-- NestedMeta::Meta(Meta::Path(path))
-- | NestedMeta::Meta(Meta::List(MetaList { path, .. }))
-- | NestedMeta::Meta(Meta::NameValue(MetaNameValue { path, .. })) => {
-- if path.is_ident("packed") {
-- let msg = if fields.is_none() {
-- // #[repr(packed)] cannot be apply on enums and will be rejected by rustc.
-- // However, we should not rely on the behavior of rustc that rejects this.
-- // https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
-- "#[repr(packed)] attribute should be applied to a struct or union"
-- } else if let NestedMeta::Meta(Meta::NameValue(..)) = repr {
-- // #[repr(packed = "")] is not valid format of #[repr(packed)] and will be
-- // rejected by rustc.
-- // However, we should not rely on the behavior of rustc that rejects this.
-- // https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
-- "#[repr(packed)] attribute should not be name-value pair"
-- } else {
-- "#[pin_project] attribute may not be used on #[repr(packed)] types"
-- };
-- bail!(repr, msg);
-- }
-- }
-- NestedMeta::Lit(..) => {}
-+ for repr in list.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)? {
-+ if repr.path().is_ident("packed") {
-+ let msg = if fields.is_none() {
-+ // #[repr(packed)] cannot be apply on enums and will be rejected by rustc.
-+ // However, we should not rely on the behavior of rustc that rejects this.
-+ // https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
-+ "#[repr(packed)] attribute should be applied to a struct or union"
-+ } else if repr.require_name_value().is_ok() {
-+ // #[repr(packed = "")] is not valid format of #[repr(packed)] and will be
-+ // rejected by rustc.
-+ // However, we should not rely on the behavior of rustc that rejects this.
-+ // https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
-+ "#[repr(packed)] attribute should not be name-value pair"
-+ } else {
-+ "#[pin_project] attribute may not be used on #[repr(packed)] types"
-+ };
-+ bail!(repr, msg);
- }
- }
- }
-@@ -1063,10 +1058,10 @@ fn ensure_not_packed(orig: &OriginalType<'_>, fields: Option<&Fields>) -> Result
- // ```rust
- // #[forbid(unaligned_references)]
- // fn assert_not_repr_packed(val: &MyStruct) {
-- // let _field1 = &val.field1;
-- // let _field2 = &val.field2;
-+ // let _field_1 = &val.field_1;
-+ // let _field_2 = &val.field_2;
- // ...
-- // let _fieldn = &val.fieldn;
-+ // let _field_n = &val.field_n;
- // }
- // ```
- //
-diff --git a/src/pinned_drop.rs b/src/pinned_drop.rs
-index 912989d..d30ecbe 100644
---- a/src/pinned_drop.rs
-+++ b/src/pinned_drop.rs
-@@ -1,16 +1,18 @@
- use proc_macro2::TokenStream;
- use quote::{format_ident, quote, ToTokens};
- use syn::{
-- parse_quote, spanned::Spanned, visit_mut::VisitMut, Error, FnArg, GenericArgument, ImplItem,
-- ItemImpl, Pat, PatIdent, Path, PathArguments, Result, ReturnType, Signature, Token, Type,
-- TypePath, TypeReference,
-+ parse_quote, spanned::Spanned, token::Colon, visit_mut::VisitMut, Error, FnArg,
-+ GenericArgument, Ident, ImplItem, ItemImpl, Pat, PatIdent, PatType, Path, PathArguments,
-+ Result, ReturnType, Signature, Token, Type, TypePath, TypeReference,
- };
-
--use crate::utils::{parse_as_empty, prepend_underscore_to_self, ReplaceReceiver, SliceExt};
-+use crate::utils::{ReplaceReceiver, SliceExt};
-
- pub(crate) fn attribute(args: &TokenStream, mut input: ItemImpl) -> TokenStream {
- let res = (|| -> Result<()> {
-- parse_as_empty(args)?;
-+ if !args.is_empty() {
-+ bail!(args, "unexpected argument: `{}`", args)
-+ }
- validate_impl(&input)?;
- expand_impl(&mut input);
- Ok(())
-@@ -85,7 +87,7 @@ fn validate_impl(item: &ItemImpl) -> Result<()> {
- ImplItem::Type(item) => {
- bail!(item, "type `{}` is not a member of trait `PinnedDrop`", item.ident)
- }
-- ImplItem::Method(method) => {
-+ ImplItem::Fn(method) => {
- validate_sig(&method.sig)?;
- if i == 0 {
- Ok(())
-@@ -124,14 +126,15 @@ fn validate_sig(sig: &Signature) -> Result<()> {
-
- match sig.inputs.len() {
- 1 => {}
-- 0 => return Err(Error::new(sig.paren_token.span, INVALID_ARGUMENT)),
-+ 0 => return Err(Error::new(sig.paren_token.span.join(), INVALID_ARGUMENT)),
- _ => bail!(sig.inputs, INVALID_ARGUMENT),
- }
-
-- if let Some(FnArg::Typed(arg)) = sig.receiver() {
-+ if let Some(arg) = sig.receiver() {
- // (mut) self: <path>
- if let Some(path) = get_ty_path(&arg.ty) {
-- let ty = path.segments.last().unwrap();
-+ let ty =
-+ path.segments.last().expect("Type paths should always have at least one segment");
- if let PathArguments::AngleBracketed(args) = &ty.arguments {
- // (mut) self: (<path>::)<ty><&mut <elem>..>
- if let Some(GenericArgument::Type(Type::Reference(TypeReference {
-@@ -175,25 +178,16 @@ fn validate_sig(sig: &Signature) -> Result<()> {
- // }
- //
- fn expand_impl(item: &mut ItemImpl) {
-- fn get_arg_pat(arg: &mut FnArg) -> Option<&mut PatIdent> {
-- if let FnArg::Typed(arg) = arg {
-- if let Pat::Ident(ident) = &mut *arg.pat {
-- return Some(ident);
-- }
-- }
-- None
-- }
--
- // `PinnedDrop` is a private trait and should not appear in docs.
- item.attrs.push(parse_quote!(#[doc(hidden)]));
-
-- let path = &mut item.trait_.as_mut().unwrap().1;
-+ let path = &mut item.trait_.as_mut().expect("unexpected inherent impl").1;
- *path = parse_quote_spanned! { path.span() =>
- ::pin_project::__private::PinnedDrop
- };
-
- let method =
-- if let ImplItem::Method(method) = &mut item.items[0] { method } else { unreachable!() };
-+ if let ImplItem::Fn(method) = &mut item.items[0] { method } else { unreachable!() };
-
- // `fn drop(mut self: Pin<&mut Self>)` -> `fn __drop_inner<T>(mut __self: Pin<&mut Receiver>)`
- let drop_inner = {
-@@ -203,8 +197,20 @@ fn expand_impl(item: &mut ItemImpl) {
- drop_inner.block.stmts.insert(0, parse_quote!(fn #ident() {}));
- drop_inner.sig.ident = ident;
- drop_inner.sig.generics = item.generics.clone();
-- let self_pat = get_arg_pat(&mut drop_inner.sig.inputs[0]).unwrap();
-- prepend_underscore_to_self(&mut self_pat.ident);
-+ let receiver = drop_inner.sig.receiver().expect("drop() should have a receiver").clone();
-+ let pat = Box::new(Pat::Ident(PatIdent {
-+ attrs: Vec::new(),
-+ by_ref: None,
-+ mutability: receiver.mutability,
-+ ident: Ident::new("__self", receiver.self_token.span()),
-+ subpat: None,
-+ }));
-+ drop_inner.sig.inputs[0] = FnArg::Typed(PatType {
-+ attrs: receiver.attrs,
-+ pat,
-+ colon_token: Colon::default(),
-+ ty: receiver.ty,
-+ });
- let self_ty = if let Type::Path(ty) = &*item.self_ty { ty } else { unreachable!() };
- let mut visitor = ReplaceReceiver(self_ty);
- visitor.visit_signature_mut(&mut drop_inner.sig);
-@@ -214,9 +220,12 @@ fn expand_impl(item: &mut ItemImpl) {
-
- // `fn drop(mut self: Pin<&mut Self>)` -> `unsafe fn drop(self: Pin<&mut Self>)`
- method.sig.unsafety = Some(<Token![unsafe]>::default());
-- let self_pat = get_arg_pat(&mut method.sig.inputs[0]).unwrap();
-- self_pat.mutability = None;
-- let self_token = &self_pat.ident;
-+ let self_token = if let FnArg::Receiver(ref mut rec) = method.sig.inputs[0] {
-+ rec.mutability = None;
-+ &rec.self_token
-+ } else {
-+ panic!("drop() should have a receiver")
-+ };
-
- method.block.stmts = parse_quote! {
- #[allow(clippy::needless_pass_by_value)] // This lint does not warn the receiver.
-diff --git a/src/utils.rs b/src/utils.rs
-index 27373ef..3f4ec85 100644
---- a/src/utils.rs
-+++ b/src/utils.rs
-@@ -8,7 +8,7 @@ use syn::{
- punctuated::Punctuated,
- token,
- visit_mut::{self, VisitMut},
-- Attribute, ExprPath, ExprStruct, Generics, Ident, Item, Lifetime, LifetimeDef, Macro, PatPath,
-+ Attribute, ExprPath, ExprStruct, Generics, Ident, Item, Lifetime, LifetimeParam, Macro,
- PatStruct, PatTupleStruct, Path, PathArguments, PredicateType, QSelf, Result, Token, Type,
- TypeParamBound, TypePath, Variant, Visibility, WherePredicate,
- };
-@@ -42,7 +42,7 @@ pub(crate) fn determine_lifetime_name(lifetime_name: &mut String, generics: &mut
- struct CollectLifetimes(Vec<String>);
-
- impl VisitMut for CollectLifetimes {
-- fn visit_lifetime_def_mut(&mut self, def: &mut LifetimeDef) {
-+ fn visit_lifetime_param_mut(&mut self, def: &mut LifetimeParam) {
- self.0.push(def.lifetime.to_string());
- }
- }
-@@ -84,7 +84,7 @@ pub(crate) fn insert_lifetime_and_bound(
- pub(crate) fn insert_lifetime(generics: &mut Generics, lifetime: Lifetime) {
- generics.lt_token.get_or_insert_with(<Token![<]>::default);
- generics.gt_token.get_or_insert_with(<Token![>]>::default);
-- generics.params.insert(0, LifetimeDef::new(lifetime).into());
-+ generics.params.insert(0, LifetimeParam::new(lifetime).into());
- }
-
- /// Determines the visibility of the projected types and projection methods.
-@@ -93,24 +93,12 @@ pub(crate) fn insert_lifetime(generics: &mut Generics, lifetime: Lifetime) {
- /// Otherwise, returned visibility is the same as given visibility.
- pub(crate) fn determine_visibility(vis: &Visibility) -> Visibility {
- if let Visibility::Public(token) = vis {
-- parse_quote_spanned!(token.pub_token.span => pub(crate))
-+ parse_quote_spanned!(token.span => pub(crate))
- } else {
- vis.clone()
- }
- }
-
--/// Checks if `tokens` is an empty `TokenStream`.
--///
--/// This is almost equivalent to `syn::parse2::<Nothing>()`, but produces
--/// a better error message and does not require ownership of `tokens`.
--pub(crate) fn parse_as_empty(tokens: &TokenStream) -> Result<()> {
-- if tokens.is_empty() {
-- Ok(())
-- } else {
-- bail!(tokens, "unexpected token: `{}`", tokens)
-- }
--}
--
- pub(crate) fn respan<T>(node: &T, span: Span) -> T
- where
- T: ToTokens + Parse,
-@@ -146,11 +134,11 @@ impl SliceExt for [Attribute] {
- fn position_exact(&self, ident: &str) -> Result<Option<usize>> {
- self.iter()
- .try_fold((0, None), |(i, mut prev), attr| {
-- if attr.path.is_ident(ident) {
-+ if attr.path().is_ident(ident) {
- if prev.replace(i).is_some() {
- bail!(attr, "duplicate #[{}] attribute", ident);
- }
-- parse_as_empty(&attr.tokens)?;
-+ attr.meta.require_path_only()?;
- }
- Ok((i + 1, prev))
- })
-@@ -158,7 +146,7 @@ impl SliceExt for [Attribute] {
- }
-
- fn find(&self, ident: &str) -> Option<&Attribute> {
-- self.iter().position(|attr| attr.path.is_ident(ident)).map(|i| &self[i])
-+ self.iter().position(|attr| attr.path().is_ident(ident)).map(|i| &self[i])
- }
- }
-
-@@ -335,13 +323,6 @@ impl VisitMut for ReplaceReceiver<'_> {
- visit_mut::visit_expr_struct_mut(self, expr);
- }
-
-- fn visit_pat_path_mut(&mut self, pat: &mut PatPath) {
-- if pat.qself.is_none() {
-- self.self_to_qself(&mut pat.qself, &mut pat.path);
-- }
-- visit_mut::visit_pat_path_mut(self, pat);
-- }
--
- fn visit_pat_struct_mut(&mut self, pat: &mut PatStruct) {
- self.self_to_expr_path(&mut pat.path);
- visit_mut::visit_pat_struct_mut(self, pat);
diff --git a/src/lib.rs b/src/lib.rs
index 07683c4..3eb3323 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,8 +14,7 @@
clippy::needless_doctest_main,
clippy::similar_names,
clippy::single_match_else,
- clippy::too_many_lines,
- clippy::unnested_or_patterns
+ clippy::too_many_lines
)]
// older compilers require explicit `extern crate`.
diff --git a/src/pin_project/args.rs b/src/pin_project/args.rs
index d242ae7..0c688a5 100644
--- a/src/pin_project/args.rs
+++ b/src/pin_project/args.rs
@@ -227,7 +227,6 @@ pub(super) enum ProjReplace {
span: Span,
},
/// `project_replace = <ident>`.
- #[allow(dead_code)] // false positive that fixed in Rust 1.38
Named {
span: Span,
ident: Ident,
diff --git a/src/pin_project/attribute.rs b/src/pin_project/attribute.rs
index 7adfc07..09cd8c7 100644
--- a/src/pin_project/attribute.rs
+++ b/src/pin_project/attribute.rs
@@ -36,7 +36,6 @@ pub(super) fn parse_attribute(args: &TokenStream, input: TokenStream) -> Result<
})
}
-#[allow(dead_code)] // false positive that fixed in Rust 1.39
struct Input {
attrs: Vec<Attribute>,
body: TokenStream,
diff --git a/src/pin_project/derive.rs b/src/pin_project/derive.rs
index d2b2b5e..bea17fe 100644
--- a/src/pin_project/derive.rs
+++ b/src/pin_project/derive.rs
@@ -718,6 +718,7 @@ fn make_unpin_impl(cx: &Context<'_>) -> TokenStream {
// call-site span.
let unsafety = <Token![unsafe]>::default();
quote_spanned! { span =>
+ #[doc(hidden)]
impl #proj_impl_generics _pin_project::__private::Unpin
for #orig_ident #ty_generics
#proj_where_clause
@@ -944,6 +945,7 @@ fn make_proj_impl(
let mut project = Some(quote! {
#allow_dead_code
+ #[inline]
#vis fn project<#lifetime>(
self: _pin_project::__private::Pin<&#lifetime mut Self>,
) -> #proj_ident #proj_ty_generics {
@@ -955,6 +957,7 @@ fn make_proj_impl(
let mut project_ref = Some(quote! {
#allow_dead_code
#[allow(clippy::missing_const_for_fn)]
+ #[inline]
#vis fn project_ref<#lifetime>(
self: _pin_project::__private::Pin<&#lifetime Self>,
) -> #proj_ref_ident #proj_ty_generics {
@@ -967,6 +970,7 @@ fn make_proj_impl(
// It is enough to only set the span of the signature.
let sig = quote_spanned! { span =>
#allow_dead_code
+ #[inline]
#vis fn project_replace(
self: _pin_project::__private::Pin<&mut Self>,
__replacement: Self,
diff --git a/src/utils.rs b/src/utils.rs
index 3f4ec85..55089cd 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -1,4 +1,4 @@
-use std::{iter::FromIterator, mem};
+use std::mem;
use proc_macro2::{Group, Spacing, Span, TokenStream, TokenTree};
use quote::{quote, quote_spanned, ToTokens};