From 2fb3d56a15c1f8777911cd59f2f0b8c698ec2b3b Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 6 Jan 2025 20:35:54 +0900 Subject: [PATCH] Suppress various lints in generated code --- CHANGELOG.md | 2 + .../src/pin_project/derive.rs | 85 ++++++------ pin-project-internal/src/pinned_drop.rs | 9 +- tests/expand/default/enum.expanded.rs | 96 +++++++------ tests/expand/default/struct.expanded.rs | 44 +++--- tests/expand/default/tuple_struct.expanded.rs | 44 +++--- tests/expand/multifields/enum.expanded.rs | 128 +++++++++++------- tests/expand/multifields/struct.expanded.rs | 47 +++---- .../multifields/tuple_struct.expanded.rs | 47 +++---- tests/expand/naming/enum-all.expanded.rs | 128 +++++++++++------- tests/expand/naming/enum-mut.expanded.rs | 66 +++++---- tests/expand/naming/enum-none.expanded.rs | 36 +++-- tests/expand/naming/enum-own.expanded.rs | 68 ++++++---- tests/expand/naming/enum-ref.expanded.rs | 66 +++++---- tests/expand/naming/struct-all.expanded.rs | 124 ++++++++++------- tests/expand/naming/struct-mut.expanded.rs | 70 ++++++---- tests/expand/naming/struct-none.expanded.rs | 44 +++--- tests/expand/naming/struct-own.expanded.rs | 72 +++++----- tests/expand/naming/struct-ref.expanded.rs | 70 ++++++---- .../naming/tuple_struct-all.expanded.rs | 124 ++++++++++------- .../naming/tuple_struct-mut.expanded.rs | 70 ++++++---- .../naming/tuple_struct-none.expanded.rs | 44 +++--- .../naming/tuple_struct-own.expanded.rs | 72 +++++----- .../naming/tuple_struct-ref.expanded.rs | 70 ++++++---- tests/expand/not_unpin/enum.expanded.rs | 94 +++++++------ tests/expand/not_unpin/struct.expanded.rs | 42 +++--- .../expand/not_unpin/tuple_struct.expanded.rs | 42 +++--- tests/expand/pinned_drop/enum.expanded.rs | 99 ++++++++------ tests/expand/pinned_drop/struct.expanded.rs | 47 ++++--- .../pinned_drop/tuple_struct.expanded.rs | 47 ++++--- tests/expand/project_replace/enum.expanded.rs | 68 ++++++---- .../expand/project_replace/struct.expanded.rs | 47 +++---- .../project_replace/tuple_struct.expanded.rs | 47 +++---- tests/expand/pub/enum.expanded.rs | 96 +++++++------ tests/expand/pub/struct.expanded.rs | 44 +++--- tests/expand/pub/tuple_struct.expanded.rs | 44 +++--- tests/expand/unsafe_unpin/enum.expanded.rs | 94 +++++++------ tests/expand/unsafe_unpin/struct.expanded.rs | 42 +++--- .../unsafe_unpin/tuple_struct.expanded.rs | 42 +++--- tests/include/basic-safe-part.rs | 23 +++- tests/include/basic.rs | 6 +- tests/lint/Cargo.toml | 3 +- tests/lint/lib.rs | 106 +++++++++++---- 43 files changed, 1538 insertions(+), 1121 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4928f7ca..82fb7f15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] +- Suppress `unnameable_types`, `clippy::absolute_paths`, `clippy::min_ident_chars`, `clippy::pub_with_shorthand`, `clippy::single_call_fn`, `clippy::single_char_lifetime_names` lints in generated code. + ## [1.1.7] - 2024-10-24 - Work around an issue on negative_impls that allows unsound overlapping `Unpin` implementations. ([#357](https://github.com/taiki-e/pin-project/pull/357)) diff --git a/pin-project-internal/src/pin_project/derive.rs b/pin-project-internal/src/pin_project/derive.rs index 0cd22a45..206b00e3 100644 --- a/pin-project-internal/src/pin_project/derive.rs +++ b/pin-project-internal/src/pin_project/derive.rs @@ -86,12 +86,14 @@ impl GenerateTokens { // - https://github.com/rust-lang/rust/issues/63281 // - https://github.com/taiki-e/pin-project/pull/53#issuecomment-525906867 // - https://github.com/taiki-e/pin-project/pull/70 - #allowed_lints - #[allow(unused_qualifications)] - #[allow(clippy::needless_lifetimes)] - #[allow(clippy::semicolon_if_nothing_returned)] - #[allow(clippy::use_self)] - #[allow(clippy::used_underscore_binding)] + #[allow( + unused_qualifications, + #allowed_lints + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding + )] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -107,52 +109,59 @@ impl GenerateTokens { /// Returns attributes that should be applied to all generated code. fn global_allowed_lints() -> TokenStream { quote! { - #[allow(deprecated)] - #[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)] + deprecated, + explicit_outlives_requirements, // https://github.com/rust-lang/rust/issues/60993 + single_use_lifetimes, // https://github.com/rust-lang/rust/issues/55058 + unreachable_pub, // This lint warns `pub` field in private struct. + 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)] - #[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 + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, // This lint warns `pub(crate)` field in private struct. + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, // https://github.com/rust-lang/rust-clippy/issues/4326 } } /// Returns attributes used on projected types. 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)] - }) - } else { - 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! { - #proj_mut_allowed_lints - #[allow(dead_code)] // This lint warns unused fields/variants. - #[allow(clippy::mut_mut)] // This lint warns `&mut &mut `. - #[allow(clippy::missing_docs_in_private_items)] + #[allow( + dead_code, // This lint warns unused fields/variants. + #proj_mut_allowed_lints + clippy::missing_docs_in_private_items, + clippy::mut_mut // This lint warns `&mut &mut `. + )] }; let proj_ref_allowed_lints = if cx.project_ref { Some(&global_allowed_lints) } else { None }; let proj_ref = quote! { - #proj_ref_allowed_lints - #[allow(dead_code)] // This lint warns unused fields/variants. - #[allow(clippy::ref_option_ref)] // This lint warns `&Option<&>`. - #[allow(clippy::missing_docs_in_private_items)] + #[allow( + dead_code, // This lint warns unused fields/variants. + #proj_ref_allowed_lints + clippy::missing_docs_in_private_items, + clippy::ref_option_ref // This lint warns `&Option<&>`. + )] }; let proj_own_allowed_lints = if cx.project_replace.ident().is_some() { Some(&global_allowed_lints) } else { None }; + let variant_size_differences = if cx.kind == Enum { + Some(quote! { variant_size_differences, clippy::large_enum_variant, }) + } else { + None + }; let proj_own = quote! { - #proj_own_allowed_lints - #[allow(dead_code)] // This lint warns unused fields/variants. - #[allow(clippy::missing_docs_in_private_items)] - #large_enum_variant + #[allow( + dead_code, // This lint warns unused fields/variants. + #proj_own_allowed_lints + #variant_size_differences + clippy::missing_docs_in_private_items + )] }; (proj_mut, proj_ref, proj_own) } @@ -808,7 +817,7 @@ fn make_unpin_impl(cx: &Context<'_>) -> TokenStream { // `__UnpinStruct` type must also be public. // However, we ensure that the user can never actually reference // this 'public' type by creating this type in the inside of `const`. - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] #vis struct #struct_ident #proj_generics #ty_where_clause { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< #lifetime, (#(_pin_project::__private::PhantomData<#type_params>),*) @@ -975,14 +984,14 @@ 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 - #[inline] #vis fn project_replace( self: _pin_project::__private::Pin<&mut Self>, __replacement: Self, ) -> #proj_own_ident #orig_ty_generics }; quote! { + #allow_dead_code + #[inline] #sig { unsafe { let __self_ptr: *mut Self = self.get_unchecked_mut(); diff --git a/pin-project-internal/src/pinned_drop.rs b/pin-project-internal/src/pinned_drop.rs index fad2df8e..f6473ebe 100644 --- a/pin-project-internal/src/pinned_drop.rs +++ b/pin-project-internal/src/pinned_drop.rs @@ -47,7 +47,13 @@ pub(crate) fn attribute(args: &TokenStream, mut input: ItemImpl) -> TokenStream } tokens } else { - input.attrs.push(parse_quote!(#[allow(unused_qualifications)])); // https://github.com/rust-lang/rust/issues/122519 + input.attrs.push(parse_quote!(#[allow( + unused_qualifications, // https://github.com/rust-lang/rust/issues/122519 + // This lint warns of `clippy::*` generated by external macros. + // We allow this lint for compatibility with older compilers. + clippy::unknown_clippy_lints, + clippy::absolute_paths + )])); input.into_token_stream() } } @@ -198,6 +204,7 @@ fn expand_impl(item: &mut ItemImpl) { let ident = format_ident!("__drop_inner"); // Add a dummy `__drop_inner` function to prevent users call outer `__drop_inner`. drop_inner.block.stmts.insert(0, parse_quote!(fn #ident() {})); + drop_inner.attrs.push(parse_quote!(#[allow(clippy::single_call_fn)])); drop_inner.sig.ident = ident; drop_inner.sig.generics = item.generics.clone(); let receiver = drop_inner.sig.receiver().expect("drop() should have a receiver").clone(); diff --git a/tests/expand/default/enum.expanded.rs b/tests/expand/default/enum.expanded.rs index 5d6863ca..c23e45b2 100644 --- a/tests/expand/default/enum.expanded.rs +++ b/tests/expand/default/enum.expanded.rs @@ -5,18 +5,24 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] enum EnumProj<'pin, T, U> where Enum: 'pin, @@ -28,18 +34,24 @@ where Tuple(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] enum EnumProjRef<'pin, T, U> where Enum: 'pin, @@ -48,20 +60,26 @@ where Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -114,7 +132,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/default/struct.expanded.rs b/tests/expand/default/struct.expanded.rs index 9b218384..5edd5fbd 100644 --- a/tests/expand/default/struct.expanded.rs +++ b/tests/expand/default/struct.expanded.rs @@ -5,26 +5,30 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -32,9 +36,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -76,7 +78,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/default/tuple_struct.expanded.rs b/tests/expand/default/tuple_struct.expanded.rs index 5145a554..ef95f0b2 100644 --- a/tests/expand/default/tuple_struct.expanded.rs +++ b/tests/expand/default/tuple_struct.expanded.rs @@ -1,35 +1,37 @@ use pin_project::pin_project; #[pin(__private())] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -70,7 +72,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/multifields/enum.expanded.rs b/tests/expand/multifields/enum.expanded.rs index 759a2c29..c7b868c5 100644 --- a/tests/expand/multifields/enum.expanded.rs +++ b/tests/expand/multifields/enum.expanded.rs @@ -11,18 +11,24 @@ enum Enum { Tuple(#[pin] T, #[pin] T, U, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] enum EnumProj<'pin, T, U> where Enum: 'pin, @@ -41,18 +47,24 @@ where ), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] enum EnumProjRef<'pin, T, U> where Enum: 'pin, @@ -71,19 +83,25 @@ where ), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] -#[allow(variant_size_differences)] -#[allow(clippy::large_enum_variant)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + variant_size_differences, + clippy::large_enum_variant, + clippy::missing_docs_in_private_items +)] enum EnumProjOwn { Struct { pinned1: ::pin_project::__private::PhantomData, @@ -99,20 +117,26 @@ enum EnumProjOwn { ), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -236,7 +260,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/multifields/struct.expanded.rs b/tests/expand/multifields/struct.expanded.rs index 2ac5126b..31cc548f 100644 --- a/tests/expand/multifields/struct.expanded.rs +++ b/tests/expand/multifields/struct.expanded.rs @@ -8,26 +8,30 @@ struct Struct { unpinned1: U, unpinned2: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -37,9 +41,7 @@ const _: () = { unpinned1: &'pin mut (U), unpinned2: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -49,8 +51,7 @@ const _: () = { unpinned1: &'pin (U), unpinned2: &'pin (U), } - #[allow(dead_code)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items)] struct __StructProjectionOwned { pinned1: ::pin_project::__private::PhantomData, pinned2: ::pin_project::__private::PhantomData, @@ -128,7 +129,7 @@ const _: () = { let _ = &this.unpinned1; let _ = &this.unpinned2; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/multifields/tuple_struct.expanded.rs b/tests/expand/multifields/tuple_struct.expanded.rs index 37e49a9d..36190ba6 100644 --- a/tests/expand/multifields/tuple_struct.expanded.rs +++ b/tests/expand/multifields/tuple_struct.expanded.rs @@ -1,26 +1,30 @@ use pin_project::pin_project; #[pin(__private(project_replace))] struct TupleStruct(#[pin] T, #[pin] T, U, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, ::pin_project::__private::Pin<&'pin mut (T)>, @@ -29,9 +33,7 @@ const _: () = { ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, ::pin_project::__private::Pin<&'pin (T)>, @@ -40,8 +42,7 @@ const _: () = { ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items)] struct __TupleStructProjectionOwned( ::pin_project::__private::PhantomData, ::pin_project::__private::PhantomData, @@ -118,7 +119,7 @@ const _: () = { let _ = &this.2; let _ = &this.3; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/enum-all.expanded.rs b/tests/expand/naming/enum-all.expanded.rs index 8eee9393..906782f3 100644 --- a/tests/expand/naming/enum-all.expanded.rs +++ b/tests/expand/naming/enum-all.expanded.rs @@ -5,18 +5,24 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] enum Proj<'pin, T, U> where Enum: 'pin, @@ -28,18 +34,24 @@ where Tuple(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] enum ProjRef<'pin, T, U> where Enum: 'pin, @@ -48,38 +60,50 @@ where Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] -#[allow(variant_size_differences)] -#[allow(clippy::large_enum_variant)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + variant_size_differences, + clippy::large_enum_variant, + clippy::missing_docs_in_private_items +)] enum ProjOwn { Struct { pinned: ::pin_project::__private::PhantomData, unpinned: U }, Tuple(::pin_project::__private::PhantomData, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -174,7 +198,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/enum-mut.expanded.rs b/tests/expand/naming/enum-mut.expanded.rs index 88c8d1d1..0937d9bf 100644 --- a/tests/expand/naming/enum-mut.expanded.rs +++ b/tests/expand/naming/enum-mut.expanded.rs @@ -5,18 +5,24 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] enum Proj<'pin, T, U> where Enum: 'pin, @@ -28,20 +34,26 @@ where Tuple(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -67,7 +79,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/enum-none.expanded.rs b/tests/expand/naming/enum-none.expanded.rs index d5761015..d4a3e782 100644 --- a/tests/expand/naming/enum-none.expanded.rs +++ b/tests/expand/naming/enum-none.expanded.rs @@ -5,25 +5,31 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; impl Enum {} - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/enum-own.expanded.rs b/tests/expand/naming/enum-own.expanded.rs index ee98c043..2506b7e3 100644 --- a/tests/expand/naming/enum-own.expanded.rs +++ b/tests/expand/naming/enum-own.expanded.rs @@ -5,38 +5,50 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] -#[allow(variant_size_differences)] -#[allow(clippy::large_enum_variant)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + variant_size_differences, + clippy::large_enum_variant, + clippy::missing_docs_in_private_items +)] enum ProjOwn { Struct { pinned: ::pin_project::__private::PhantomData, unpinned: U }, Tuple(::pin_project::__private::PhantomData, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -87,7 +99,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/enum-ref.expanded.rs b/tests/expand/naming/enum-ref.expanded.rs index b55e59b5..7bb927d4 100644 --- a/tests/expand/naming/enum-ref.expanded.rs +++ b/tests/expand/naming/enum-ref.expanded.rs @@ -5,18 +5,24 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] enum ProjRef<'pin, T, U> where Enum: 'pin, @@ -25,20 +31,26 @@ where Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -68,7 +80,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/struct-all.expanded.rs b/tests/expand/naming/struct-all.expanded.rs index 5d9c0e8f..6bb64b6f 100644 --- a/tests/expand/naming/struct-all.expanded.rs +++ b/tests/expand/naming/struct-all.expanded.rs @@ -5,18 +5,24 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] struct Proj<'pin, T, U> where Struct: 'pin, @@ -24,18 +30,24 @@ where pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] struct ProjRef<'pin, T, U> where Struct: 'pin, @@ -43,35 +55,47 @@ where pinned: ::pin_project::__private::Pin<&'pin (T)>, unpinned: &'pin (U), } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items +)] struct ProjOwn { pinned: ::pin_project::__private::PhantomData, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -134,7 +158,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/struct-mut.expanded.rs b/tests/expand/naming/struct-mut.expanded.rs index 19d41a92..116ce5d4 100644 --- a/tests/expand/naming/struct-mut.expanded.rs +++ b/tests/expand/naming/struct-mut.expanded.rs @@ -5,18 +5,24 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] struct Proj<'pin, T, U> where Struct: 'pin, @@ -24,26 +30,30 @@ where pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -85,7 +95,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/struct-none.expanded.rs b/tests/expand/naming/struct-none.expanded.rs index 9b218384..5edd5fbd 100644 --- a/tests/expand/naming/struct-none.expanded.rs +++ b/tests/expand/naming/struct-none.expanded.rs @@ -5,26 +5,30 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -32,9 +36,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -76,7 +78,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/struct-own.expanded.rs b/tests/expand/naming/struct-own.expanded.rs index 76830cfe..31dde810 100644 --- a/tests/expand/naming/struct-own.expanded.rs +++ b/tests/expand/naming/struct-own.expanded.rs @@ -5,41 +5,51 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items +)] struct ProjOwn { pinned: ::pin_project::__private::PhantomData, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -47,9 +57,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -116,7 +124,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/struct-ref.expanded.rs b/tests/expand/naming/struct-ref.expanded.rs index f01dffe1..c3a60e38 100644 --- a/tests/expand/naming/struct-ref.expanded.rs +++ b/tests/expand/naming/struct-ref.expanded.rs @@ -5,18 +5,24 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] struct ProjRef<'pin, T, U> where Struct: 'pin, @@ -24,26 +30,30 @@ where pinned: ::pin_project::__private::Pin<&'pin (T)>, unpinned: &'pin (U), } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -85,7 +95,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/tuple_struct-all.expanded.rs b/tests/expand/naming/tuple_struct-all.expanded.rs index 0dcb6184..f55a4559 100644 --- a/tests/expand/naming/tuple_struct-all.expanded.rs +++ b/tests/expand/naming/tuple_struct-all.expanded.rs @@ -1,68 +1,92 @@ use pin_project::pin_project; #[pin(__private(project = Proj, project_ref = ProjRef, project_replace = ProjOwn))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] struct Proj<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] struct ProjRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), ) where TupleStruct: 'pin; -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items +)] struct ProjOwn(::pin_project::__private::PhantomData, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -119,7 +143,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/tuple_struct-mut.expanded.rs b/tests/expand/naming/tuple_struct-mut.expanded.rs index b2491ec3..7d6ebef5 100644 --- a/tests/expand/naming/tuple_struct-mut.expanded.rs +++ b/tests/expand/naming/tuple_struct-mut.expanded.rs @@ -1,44 +1,54 @@ use pin_project::pin_project; #[pin(__private(project = Proj))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] struct Proj<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -76,7 +86,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/tuple_struct-none.expanded.rs b/tests/expand/naming/tuple_struct-none.expanded.rs index 5145a554..ef95f0b2 100644 --- a/tests/expand/naming/tuple_struct-none.expanded.rs +++ b/tests/expand/naming/tuple_struct-none.expanded.rs @@ -1,35 +1,37 @@ use pin_project::pin_project; #[pin(__private())] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -70,7 +72,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/tuple_struct-own.expanded.rs b/tests/expand/naming/tuple_struct-own.expanded.rs index c3cb7614..9c964354 100644 --- a/tests/expand/naming/tuple_struct-own.expanded.rs +++ b/tests/expand/naming/tuple_struct-own.expanded.rs @@ -1,47 +1,55 @@ use pin_project::pin_project; #[pin(__private(project_replace = ProjOwn))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items +)] struct ProjOwn(::pin_project::__private::PhantomData, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -107,7 +115,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/naming/tuple_struct-ref.expanded.rs b/tests/expand/naming/tuple_struct-ref.expanded.rs index af693a6a..fb736411 100644 --- a/tests/expand/naming/tuple_struct-ref.expanded.rs +++ b/tests/expand/naming/tuple_struct-ref.expanded.rs @@ -1,44 +1,54 @@ use pin_project::pin_project; #[pin(__private(project_ref = ProjRef))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] struct ProjRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), ) where TupleStruct: 'pin; -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), @@ -76,7 +86,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/not_unpin/enum.expanded.rs b/tests/expand/not_unpin/enum.expanded.rs index ec9b3dd9..7a5de87e 100644 --- a/tests/expand/not_unpin/enum.expanded.rs +++ b/tests/expand/not_unpin/enum.expanded.rs @@ -5,18 +5,24 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] enum EnumProj<'pin, T, U> where Enum: 'pin, @@ -28,18 +34,24 @@ where Tuple(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] enum EnumProjRef<'pin, T, U> where Enum: 'pin, @@ -48,20 +60,26 @@ where Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; diff --git a/tests/expand/not_unpin/struct.expanded.rs b/tests/expand/not_unpin/struct.expanded.rs index 3e3cf27b..cd515cfe 100644 --- a/tests/expand/not_unpin/struct.expanded.rs +++ b/tests/expand/not_unpin/struct.expanded.rs @@ -5,26 +5,30 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -32,9 +36,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, diff --git a/tests/expand/not_unpin/tuple_struct.expanded.rs b/tests/expand/not_unpin/tuple_struct.expanded.rs index 022512c2..4f94f8ec 100644 --- a/tests/expand/not_unpin/tuple_struct.expanded.rs +++ b/tests/expand/not_unpin/tuple_struct.expanded.rs @@ -1,35 +1,37 @@ use pin_project::pin_project; #[pin(__private(!Unpin))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), diff --git a/tests/expand/pinned_drop/enum.expanded.rs b/tests/expand/pinned_drop/enum.expanded.rs index f861fcc8..045cbc8a 100644 --- a/tests/expand/pinned_drop/enum.expanded.rs +++ b/tests/expand/pinned_drop/enum.expanded.rs @@ -6,18 +6,24 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] enum EnumProj<'pin, T, U> where Enum: 'pin, @@ -29,18 +35,24 @@ where Tuple(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] enum EnumProjRef<'pin, T, U> where Enum: 'pin, @@ -49,20 +61,26 @@ where Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -115,7 +133,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, @@ -151,10 +169,11 @@ const _: () = { } }; #[doc(hidden)] -#[allow(unused_qualifications)] +#[allow(unused_qualifications, clippy::unknown_clippy_lints, clippy::absolute_paths)] impl ::pin_project::__private::PinnedDrop for Enum { unsafe fn drop(self: Pin<&mut Self>) { #[allow(clippy::needless_pass_by_value)] + #[allow(clippy::single_call_fn)] fn __drop_inner(__self: Pin<&mut Enum>) { fn __drop_inner() {} let _ = __self; diff --git a/tests/expand/pinned_drop/struct.expanded.rs b/tests/expand/pinned_drop/struct.expanded.rs index e7d746bf..0aad355c 100644 --- a/tests/expand/pinned_drop/struct.expanded.rs +++ b/tests/expand/pinned_drop/struct.expanded.rs @@ -6,26 +6,30 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -33,9 +37,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -77,7 +79,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, @@ -112,10 +114,11 @@ const _: () = { } }; #[doc(hidden)] -#[allow(unused_qualifications)] +#[allow(unused_qualifications, clippy::unknown_clippy_lints, clippy::absolute_paths)] impl ::pin_project::__private::PinnedDrop for Struct { unsafe fn drop(self: Pin<&mut Self>) { #[allow(clippy::needless_pass_by_value)] + #[allow(clippy::single_call_fn)] fn __drop_inner(__self: Pin<&mut Struct>) { fn __drop_inner() {} let _ = __self; diff --git a/tests/expand/pinned_drop/tuple_struct.expanded.rs b/tests/expand/pinned_drop/tuple_struct.expanded.rs index 431b9b2f..064569db 100644 --- a/tests/expand/pinned_drop/tuple_struct.expanded.rs +++ b/tests/expand/pinned_drop/tuple_struct.expanded.rs @@ -2,35 +2,37 @@ use std::pin::Pin; use pin_project::{pin_project, pinned_drop}; #[pin(__private(PinnedDrop))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -71,7 +73,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, @@ -106,10 +108,11 @@ const _: () = { } }; #[doc(hidden)] -#[allow(unused_qualifications)] +#[allow(unused_qualifications, clippy::unknown_clippy_lints, clippy::absolute_paths)] impl ::pin_project::__private::PinnedDrop for TupleStruct { unsafe fn drop(self: Pin<&mut Self>) { #[allow(clippy::needless_pass_by_value)] + #[allow(clippy::single_call_fn)] fn __drop_inner(__self: Pin<&mut TupleStruct>) { fn __drop_inner() {} let _ = __self; diff --git a/tests/expand/project_replace/enum.expanded.rs b/tests/expand/project_replace/enum.expanded.rs index 7680f5e6..4e9688b7 100644 --- a/tests/expand/project_replace/enum.expanded.rs +++ b/tests/expand/project_replace/enum.expanded.rs @@ -5,38 +5,50 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::missing_docs_in_private_items)] -#[allow(variant_size_differences)] -#[allow(clippy::large_enum_variant)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + variant_size_differences, + clippy::large_enum_variant, + clippy::missing_docs_in_private_items +)] enum EnumProjOwn { Struct { pinned: ::pin_project::__private::PhantomData, unpinned: U }, Tuple(::pin_project::__private::PhantomData, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -87,7 +99,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/project_replace/struct.expanded.rs b/tests/expand/project_replace/struct.expanded.rs index a07f6928..6e420356 100644 --- a/tests/expand/project_replace/struct.expanded.rs +++ b/tests/expand/project_replace/struct.expanded.rs @@ -5,26 +5,30 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -32,9 +36,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -42,8 +44,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin (T)>, unpinned: &'pin (U), } - #[allow(dead_code)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items)] struct __StructProjectionOwned { pinned: ::pin_project::__private::PhantomData, unpinned: U, @@ -107,7 +108,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/project_replace/tuple_struct.expanded.rs b/tests/expand/project_replace/tuple_struct.expanded.rs index 92cb3e0e..c5b9be5a 100644 --- a/tests/expand/project_replace/tuple_struct.expanded.rs +++ b/tests/expand/project_replace/tuple_struct.expanded.rs @@ -1,43 +1,44 @@ use pin_project::pin_project; #[pin(__private(project_replace))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items)] struct __TupleStructProjectionOwned( ::pin_project::__private::PhantomData, U, @@ -101,7 +102,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/pub/enum.expanded.rs b/tests/expand/pub/enum.expanded.rs index fbdc4ca1..58d3a429 100644 --- a/tests/expand/pub/enum.expanded.rs +++ b/tests/expand/pub/enum.expanded.rs @@ -5,18 +5,24 @@ pub enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] pub(crate) enum EnumProj<'pin, T, U> where Enum: 'pin, @@ -28,18 +34,24 @@ where Tuple(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] pub(crate) enum EnumProjRef<'pin, T, U> where Enum: 'pin, @@ -48,20 +60,26 @@ where Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; @@ -114,7 +132,7 @@ const _: () = { } } } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] pub struct __Enum<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/pub/struct.expanded.rs b/tests/expand/pub/struct.expanded.rs index 0d615a61..b2216cc0 100644 --- a/tests/expand/pub/struct.expanded.rs +++ b/tests/expand/pub/struct.expanded.rs @@ -5,26 +5,30 @@ pub struct Struct { pub pinned: T, pub unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] pub(crate) struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -32,9 +36,7 @@ const _: () = { pub pinned: ::pin_project::__private::Pin<&'pin mut (T)>, pub unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] pub(crate) struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, @@ -76,7 +78,7 @@ const _: () = { let _ = &this.pinned; let _ = &this.unpinned; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] pub struct __Struct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/pub/tuple_struct.expanded.rs b/tests/expand/pub/tuple_struct.expanded.rs index 3c42fc7a..2f2633f4 100644 --- a/tests/expand/pub/tuple_struct.expanded.rs +++ b/tests/expand/pub/tuple_struct.expanded.rs @@ -1,35 +1,37 @@ use pin_project::pin_project; #[pin(__private())] pub struct TupleStruct(#[pin] pub T, pub U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] pub(crate) struct __TupleStructProjection<'pin, T, U>( pub ::pin_project::__private::Pin<&'pin mut (T)>, pub &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] pub(crate) struct __TupleStructProjectionRef<'pin, T, U>( pub ::pin_project::__private::Pin<&'pin (T)>, pub &'pin (U), @@ -70,7 +72,7 @@ const _: () = { let _ = &this.0; let _ = &this.1; } - #[allow(missing_debug_implementations)] + #[allow(missing_debug_implementations, unnameable_types)] pub struct __TupleStruct<'pin, T, U> { __pin_project_use_generics: _pin_project::__private::AlwaysUnpin< 'pin, diff --git a/tests/expand/unsafe_unpin/enum.expanded.rs b/tests/expand/unsafe_unpin/enum.expanded.rs index e0d20ac6..3917bc14 100644 --- a/tests/expand/unsafe_unpin/enum.expanded.rs +++ b/tests/expand/unsafe_unpin/enum.expanded.rs @@ -5,18 +5,24 @@ enum Enum { Tuple(#[pin] T, U), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::mut_mut)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::mut_mut +)] enum EnumProj<'pin, T, U> where Enum: 'pin, @@ -28,18 +34,24 @@ where Tuple(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(dead_code)] -#[allow(clippy::ref_option_ref)] -#[allow(clippy::missing_docs_in_private_items)] +#[allow( + dead_code, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::missing_docs_in_private_items, + clippy::ref_option_ref +)] enum EnumProjRef<'pin, T, U> where Enum: 'pin, @@ -48,20 +60,26 @@ where Tuple(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)), Unit, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; diff --git a/tests/expand/unsafe_unpin/struct.expanded.rs b/tests/expand/unsafe_unpin/struct.expanded.rs index 549c5451..35ea5ec2 100644 --- a/tests/expand/unsafe_unpin/struct.expanded.rs +++ b/tests/expand/unsafe_unpin/struct.expanded.rs @@ -5,26 +5,30 @@ struct Struct { pinned: T, unpinned: U, } -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __StructProjection<'pin, T, U> where Struct: 'pin, @@ -32,9 +36,7 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __StructProjectionRef<'pin, T, U> where Struct: 'pin, diff --git a/tests/expand/unsafe_unpin/tuple_struct.expanded.rs b/tests/expand/unsafe_unpin/tuple_struct.expanded.rs index e46686b3..889df854 100644 --- a/tests/expand/unsafe_unpin/tuple_struct.expanded.rs +++ b/tests/expand/unsafe_unpin/tuple_struct.expanded.rs @@ -1,35 +1,37 @@ use pin_project::{pin_project, UnsafeUnpin}; #[pin(__private(UnsafeUnpin))] struct TupleStruct(#[pin] T, U); -#[allow(deprecated)] -#[allow(explicit_outlives_requirements)] -#[allow(single_use_lifetimes)] -#[allow(unreachable_pub)] -#[allow(unused_tuple_struct_fields)] -#[allow(clippy::unknown_clippy_lints)] -#[allow(clippy::pattern_type_mismatch)] -#[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] -#[allow(unused_qualifications)] -#[allow(clippy::needless_lifetimes)] -#[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] -#[allow(clippy::used_underscore_binding)] +#[allow( + unused_qualifications, + deprecated, + explicit_outlives_requirements, + single_use_lifetimes, + unreachable_pub, + unused_tuple_struct_fields, + clippy::unknown_clippy_lints, + clippy::absolute_paths, + clippy::min_ident_chars, + clippy::pattern_type_mismatch, + clippy::pub_with_shorthand, + clippy::redundant_pub_crate, + clippy::single_char_lifetime_names, + clippy::type_repetition_in_bounds, + clippy::needless_lifetimes, + clippy::semicolon_if_nothing_returned, + clippy::use_self, + clippy::used_underscore_binding +)] const _: () = { #[allow(unused_extern_crates)] extern crate pin_project as _pin_project; - #[allow(dead_code)] - #[allow(clippy::mut_mut)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::mut_mut)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct: 'pin; - #[allow(dead_code)] - #[allow(clippy::ref_option_ref)] - #[allow(clippy::missing_docs_in_private_items)] + #[allow(dead_code, clippy::missing_docs_in_private_items, clippy::ref_option_ref)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), diff --git a/tests/include/basic-safe-part.rs b/tests/include/basic-safe-part.rs index 71e022ae..0c453572 100644 --- a/tests/include/basic-safe-part.rs +++ b/tests/include/basic-safe-part.rs @@ -3,6 +3,7 @@ // default #[pin_project], PinnedDrop, project_replace, !Unpin, and UnsafeUnpin without UnsafeUnpin impl are completely safe. /// Testing default struct. +#[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project] #[derive(Debug)] pub struct DefaultStruct { @@ -19,6 +20,7 @@ pub struct DefaultStruct { project_ref = DefaultStructNamedProjRef, )] #[derive(Debug)] +#[allow(clippy::exhaustive_structs)] // for the type itself pub struct DefaultStructNamed { /// Pinned field. #[pin] @@ -29,6 +31,7 @@ pub struct DefaultStructNamed { /// Testing default tuple struct. #[::pin_project::pin_project] +#[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct DefaultTupleStruct(#[pin] pub T, pub U); @@ -37,10 +40,12 @@ pub struct DefaultTupleStruct(#[pin] pub T, pub U); project = DefaultTupleStructNamedProj, project_ref = DefaultTupleStructNamedProjRef, )] +#[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct DefaultTupleStructNamed(#[pin] pub T, pub U); /// Testing enum. +#[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( project = DefaultEnumProj, project_ref = DefaultEnumProjRef, @@ -62,6 +67,7 @@ pub enum DefaultEnum { } /// Testing pinned drop struct. +#[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(PinnedDrop)] #[derive(Debug)] pub struct PinnedDropStruct { @@ -78,6 +84,7 @@ impl PinnedDrop for PinnedDropStruct { } /// Testing pinned drop tuple struct. +#[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(PinnedDrop)] #[derive(Debug)] pub struct PinnedDropTupleStruct(#[pin] pub T, pub U); @@ -88,13 +95,14 @@ impl PinnedDrop for PinnedDropTupleStruct { } /// Testing pinned drop enum. +#[allow(clippy::absolute_paths, clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( PinnedDrop, project = PinnedDropEnumProj, project_ref = PinnedDropEnumProjRef, )] #[derive(Debug)] -pub enum PinnedDropEnum { +pub enum PinnedDropEnum { /// Struct variant. Struct { /// Pinned field. @@ -110,11 +118,12 @@ pub enum PinnedDropEnum { } #[::pin_project::pinned_drop] -impl PinnedDrop for PinnedDropEnum { +impl PinnedDrop for PinnedDropEnum { fn drop(self: ::pin_project::__private::Pin<&mut Self>) {} } /// Testing default struct with replace. +#[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(project_replace)] #[derive(Debug)] pub struct ReplaceStruct { @@ -131,6 +140,7 @@ pub struct ReplaceStruct { project_ref = ReplaceStructNamedProjRef, project_replace = ReplaceStructNamedProjOwn, )] +#[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct ReplaceStructNamed { /// Pinned field. @@ -143,6 +153,7 @@ pub struct ReplaceStructNamed { /// Testing default struct with replace. #[::pin_project::pin_project(project_replace)] #[derive(Debug)] +#[allow(clippy::exhaustive_structs)] // for the type itself pub struct ReplaceTupleStruct(#[pin] pub T, pub U); /// Testing named struct with replace. @@ -152,9 +163,11 @@ pub struct ReplaceTupleStruct(#[pin] pub T, pub U); project_replace = ReplaceTupleStructNamedProjOwn, )] #[derive(Debug)] +#[allow(clippy::exhaustive_structs)] // for the type itself pub struct ReplaceTupleStructNamed(#[pin] pub T, pub U); /// Testing enum with replace. +#[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( project = ReplaceEnumProj, project_ref = ReplaceEnumProjRef, @@ -178,6 +191,7 @@ pub enum ReplaceEnum { /// Testing struct with unsafe `Unpin`. #[::pin_project::pin_project(UnsafeUnpin)] +#[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct UnsafeUnpinStruct { /// Pinned field. @@ -189,10 +203,12 @@ pub struct UnsafeUnpinStruct { /// Testing tuple struct with unsafe `Unpin`. #[::pin_project::pin_project(UnsafeUnpin)] +#[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct UnsafeUnpinTupleStruct(#[pin] pub T, pub U); /// Testing enum unsafe `Unpin`. +#[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( UnsafeUnpin, project = UnsafeUnpinEnumProj, @@ -217,6 +233,7 @@ pub enum UnsafeUnpinEnum { /// Testing struct with `!Unpin`. #[::pin_project::pin_project(!Unpin)] #[derive(Debug)] +#[allow(clippy::exhaustive_structs)] // for the type itself pub struct NotUnpinStruct { /// Pinned field. #[pin] @@ -226,11 +243,13 @@ pub struct NotUnpinStruct { } /// Testing tuple struct with `!Unpin`. +#[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(!Unpin)] #[derive(Debug)] pub struct NotUnpinTupleStruct(#[pin] pub T, pub U); /// Testing enum with `!Unpin`. +#[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( !Unpin, project = NotUnpinEnumProj, diff --git a/tests/include/basic.rs b/tests/include/basic.rs index d4c1c951..a506cad1 100644 --- a/tests/include/basic.rs +++ b/tests/include/basic.rs @@ -2,17 +2,17 @@ include!("basic-safe-part.rs"); -#[allow(unused_qualifications, clippy::undocumented_unsafe_blocks)] +#[allow(unused_qualifications, clippy::absolute_paths, clippy::undocumented_unsafe_blocks)] unsafe impl ::pin_project::UnsafeUnpin for UnsafeUnpinStruct { } -#[allow(unused_qualifications, clippy::undocumented_unsafe_blocks)] +#[allow(unused_qualifications, clippy::absolute_paths, clippy::undocumented_unsafe_blocks)] unsafe impl ::pin_project::UnsafeUnpin for UnsafeUnpinTupleStruct { } -#[allow(unused_qualifications, clippy::undocumented_unsafe_blocks)] +#[allow(unused_qualifications, clippy::absolute_paths, clippy::undocumented_unsafe_blocks)] unsafe impl ::pin_project::UnsafeUnpin for UnsafeUnpinEnum { diff --git a/tests/lint/Cargo.toml b/tests/lint/Cargo.toml index 2c5811d6..6b775809 100644 --- a/tests/lint/Cargo.toml +++ b/tests/lint/Cargo.toml @@ -11,4 +11,5 @@ path = "lib.rs" pin-project = { path = "../.." } [lints] -workspace = true +# Set at the crate root. +# workspace = true diff --git a/tests/lint/lib.rs b/tests/lint/lib.rs index f6709d89..02099548 100644 --- a/tests/lint/lib.rs +++ b/tests/lint/lib.rs @@ -2,8 +2,7 @@ //! Check interoperability with rustc and clippy lints. -// for old compilers -#![allow(unknown_lints)] +#![allow(unknown_lints)] // for old compilers #![warn(nonstandard_style, rust_2018_idioms, unused, deprecated_safe)] // Note: This does not guarantee compatibility with forbidding these lints in the future. // If rustc adds a new lint, we may not be able to keep this. @@ -14,7 +13,7 @@ rust_2024_compatibility )] // lints forbidden as a part of future_incompatible, rust_2018_compatibility, rust_2021_compatibility, rust_2024_compatibility are not included in the list below. -// elided_lifetimes_in_paths, explicit_outlives_requirements, unused_extern_crates: as a part of rust_2018_idioms +// elided_lifetimes_in_paths, explicit_outlives_requirements, unused_extern_crates: included as a part of rust_2018_idioms // non_exhaustive_omitted_patterns, multiple_supertrait_upcastable: unstable // unstable_features: no way to generate #![feature(..)] by macros, expect for unstable inner attribute. and this lint is deprecated: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unstable-features // unused_crate_dependencies, must_not_suspend: unrelated @@ -34,7 +33,7 @@ missing_copy_implementations, missing_debug_implementations, missing_docs, - non_ascii_idents, + non_ascii_idents, // TODO: add test case non_local_definitions, noop_method_call, private_bounds, @@ -45,7 +44,7 @@ trivial_casts, trivial_numeric_casts, unit_bindings, - // unnameable_types, // TODO + unnameable_types, unqualified_local_imports, unreachable_pub, unused_import_braces, @@ -57,18 +56,10 @@ #![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::restriction)] #![allow(clippy::blanket_clippy_restriction_lints)] // this is a test, so enable all restriction lints intentionally. #![allow( - clippy::absolute_paths, clippy::allow_attributes, clippy::allow_attributes_without_reason, - clippy::arbitrary_source_item_ordering, - clippy::exhaustive_enums, - clippy::exhaustive_structs, - clippy::min_ident_chars, - clippy::pub_with_shorthand, - clippy::single_call_fn, - clippy::single_char_lifetime_names + clippy::arbitrary_source_item_ordering )] // TODO -#![allow(clippy::lint_groups_priority)] // https://github.com/rust-lang/rust-clippy/issues/12920 /// Test for basic cases. pub mod basic { @@ -83,6 +74,7 @@ pub mod basic { /// Testing default struct. #[::pin_project::pin_project] #[derive(Debug)] + #[allow(clippy::exhaustive_structs)] // for the type itself pub struct DefaultStruct { /// Pinned field. #[pin] @@ -97,6 +89,7 @@ pub mod basic { project_ref = DefaultStructNamedProjRef, )] #[derive(Debug)] + #[allow(clippy::exhaustive_structs)] // for the type itself pub struct DefaultStructNamed { /// Pinned field. #[pin] @@ -106,11 +99,13 @@ pub mod basic { } /// Testing default tuple struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project] #[derive(Debug)] pub struct DefaultTupleStruct(#[pin] pub T, pub U); /// Testing named tuple struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project( project = DefaultTupleStructNamedProj, project_ref = DefaultTupleStructNamedProjRef, @@ -119,6 +114,7 @@ pub mod basic { pub struct DefaultTupleStructNamed(#[pin] pub T, pub U); /// Testing enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( project = DefaultEnumProj, project_ref = DefaultEnumProjRef, @@ -140,6 +136,7 @@ pub mod basic { } /// Testing pinned drop struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(PinnedDrop)] #[derive(Debug)] pub struct PinnedDropStruct { @@ -156,6 +153,7 @@ pub mod basic { } /// Testing pinned drop tuple struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(PinnedDrop)] #[derive(Debug)] pub struct PinnedDropTupleStruct(#[pin] pub T, pub U); @@ -166,6 +164,7 @@ pub mod basic { } /// Testing pinned drop enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( PinnedDrop, project = PinnedDropEnumProj, @@ -195,6 +194,7 @@ pub mod basic { /// Testing default struct with replace. #[::pin_project::pin_project(project_replace)] #[derive(Debug)] + #[allow(clippy::exhaustive_structs)] // for the type itself pub struct ReplaceStruct { /// Pinned field. #[pin] @@ -204,6 +204,7 @@ pub mod basic { } /// Testing named struct with replace. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project( project = ReplaceStructNamedProj, project_ref = ReplaceStructNamedProjRef, @@ -220,10 +221,12 @@ pub mod basic { /// Testing default struct with replace. #[::pin_project::pin_project(project_replace)] + #[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct ReplaceTupleStruct(#[pin] pub T, pub U); /// Testing named struct with replace. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project( project = ReplaceTupleStructNamedProj, project_ref = ReplaceTupleStructNamedProjRef, @@ -233,6 +236,7 @@ pub mod basic { pub struct ReplaceTupleStructNamed(#[pin] pub T, pub U); /// Testing enum with replace. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( project = ReplaceEnumProj, project_ref = ReplaceEnumProjRef, @@ -255,6 +259,7 @@ pub mod basic { } /// Testing struct with unsafe `Unpin`. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(UnsafeUnpin)] #[derive(Debug)] pub struct UnsafeUnpinStruct { @@ -266,11 +271,13 @@ pub mod basic { } /// Testing tuple struct with unsafe `Unpin`. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(UnsafeUnpin)] #[derive(Debug)] pub struct UnsafeUnpinTupleStruct(#[pin] pub T, pub U); /// Testing enum unsafe `Unpin`. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( UnsafeUnpin, project = UnsafeUnpinEnumProj, @@ -294,6 +301,7 @@ pub mod basic { /// Testing struct with `!Unpin`. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(!Unpin)] #[derive(Debug)] pub struct NotUnpinStruct { @@ -305,11 +313,13 @@ pub mod basic { } /// Testing tuple struct with `!Unpin`. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(!Unpin)] #[derive(Debug)] pub struct NotUnpinTupleStruct(#[pin] pub T, pub U); /// Testing enum with `!Unpin`. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( !Unpin, project = NotUnpinEnumProj, @@ -367,6 +377,7 @@ pub mod forbid_unsafe { () => { /// Testing default struct. #[::pin_project::pin_project] + #[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct DefaultStruct { /// Pinned field. @@ -377,6 +388,7 @@ pub mod forbid_unsafe { } /// Testing named struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project( project = DefaultStructNamedProj, project_ref = DefaultStructNamedProjRef, @@ -391,11 +403,13 @@ pub mod forbid_unsafe { } /// Testing default tuple struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project] #[derive(Debug)] pub struct DefaultTupleStruct(#[pin] pub T, pub U); /// Testing named tuple struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project( project = DefaultTupleStructNamedProj, project_ref = DefaultTupleStructNamedProjRef, @@ -404,6 +418,7 @@ pub mod forbid_unsafe { pub struct DefaultTupleStructNamed(#[pin] pub T, pub U); /// Testing enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( project = DefaultEnumProj, project_ref = DefaultEnumProjRef, @@ -425,6 +440,7 @@ pub mod forbid_unsafe { } /// Testing pinned drop struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(PinnedDrop)] #[derive(Debug)] pub struct PinnedDropStruct { @@ -441,6 +457,7 @@ pub mod forbid_unsafe { } /// Testing pinned drop tuple struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(PinnedDrop)] #[derive(Debug)] pub struct PinnedDropTupleStruct(#[pin] pub T, pub U); @@ -451,6 +468,7 @@ pub mod forbid_unsafe { } /// Testing pinned drop enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( PinnedDrop, project = PinnedDropEnumProj, @@ -479,6 +497,7 @@ pub mod forbid_unsafe { /// Testing default struct with replace. #[::pin_project::pin_project(project_replace)] + #[allow(clippy::exhaustive_structs)] // for the type itself #[derive(Debug)] pub struct ReplaceStruct { /// Pinned field. @@ -489,6 +508,7 @@ pub mod forbid_unsafe { } /// Testing named struct with replace. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project( project = ReplaceStructNamedProj, project_ref = ReplaceStructNamedProjRef, @@ -504,11 +524,13 @@ pub mod forbid_unsafe { } /// Testing default struct with replace. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(project_replace)] #[derive(Debug)] pub struct ReplaceTupleStruct(#[pin] pub T, pub U); /// Testing named struct with replace. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project( project = ReplaceTupleStructNamedProj, project_ref = ReplaceTupleStructNamedProjRef, @@ -518,6 +540,7 @@ pub mod forbid_unsafe { pub struct ReplaceTupleStructNamed(#[pin] pub T, pub U); /// Testing enum with replace. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( project = ReplaceEnumProj, project_ref = ReplaceEnumProjRef, @@ -540,6 +563,7 @@ pub mod forbid_unsafe { } /// Testing struct with unsafe `Unpin`. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(UnsafeUnpin)] #[derive(Debug)] pub struct UnsafeUnpinStruct { @@ -551,11 +575,13 @@ pub mod forbid_unsafe { } /// Testing tuple struct with unsafe `Unpin`. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(UnsafeUnpin)] #[derive(Debug)] pub struct UnsafeUnpinTupleStruct(#[pin] pub T, pub U); /// Testing enum unsafe `Unpin`. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( UnsafeUnpin, project = UnsafeUnpinEnumProj, @@ -580,6 +606,7 @@ pub mod forbid_unsafe { /// Testing struct with `!Unpin`. #[::pin_project::pin_project(!Unpin)] #[derive(Debug)] + #[allow(clippy::exhaustive_structs)] // for the type itself pub struct NotUnpinStruct { /// Pinned field. #[pin] @@ -589,11 +616,13 @@ pub mod forbid_unsafe { } /// Testing tuple struct with `!Unpin`. + #[allow(clippy::exhaustive_structs)] // for the type itself #[::pin_project::pin_project(!Unpin)] #[derive(Debug)] pub struct NotUnpinTupleStruct(#[pin] pub T, pub U); /// Testing enum with `!Unpin`. + #[allow(clippy::exhaustive_enums)] // for the type itself #[::pin_project::pin_project( !Unpin, project = NotUnpinEnumProj, @@ -626,7 +655,7 @@ pub mod deprecated { use pin_project::pin_project; /// Testing struct. - #[allow(deprecated)] // for the type itself + #[allow(deprecated, clippy::exhaustive_structs, clippy::min_ident_chars)] // for the type itself #[pin_project(project_replace)] #[derive(Debug, Clone, Copy)] #[deprecated] @@ -641,7 +670,7 @@ pub mod deprecated { } /// Testing tuple struct. - #[allow(deprecated)] // for the type itself + #[allow(deprecated, clippy::exhaustive_structs)] // for the type itself #[pin_project(project_replace)] #[derive(Debug, Clone, Copy)] #[deprecated] @@ -656,7 +685,7 @@ pub mod deprecated { ); /// Testing enum. - #[allow(deprecated)] // for the type itself + #[allow(deprecated, clippy::exhaustive_enums, clippy::min_ident_chars)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -698,7 +727,7 @@ pub mod deprecated { macro_rules! mac { () => { /// Testing struct. - #[allow(deprecated)] // for the type itself + #[allow(deprecated, clippy::exhaustive_structs, clippy::min_ident_chars)] // for the type itself #[pin_project(project_replace)] #[derive(Debug, Clone, Copy)] #[deprecated] @@ -713,7 +742,7 @@ pub mod deprecated { } /// Testing tuple struct. - #[allow(deprecated)] // for the type itself + #[allow(deprecated, clippy::exhaustive_structs)] // for the type itself #[pin_project(project_replace)] #[derive(Debug, Clone, Copy)] #[deprecated] @@ -728,7 +757,7 @@ pub mod deprecated { ); /// Testing enum. - #[allow(deprecated)] // for the type itself + #[allow(deprecated, clippy::exhaustive_enums, clippy::min_ident_chars)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -773,6 +802,7 @@ pub mod explicit_outlives_requirements { /// Testing struct. #[allow(explicit_outlives_requirements)] // for the type itself: https://github.com/rust-lang/rust/issues/60993 + #[allow(clippy::exhaustive_structs, clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct Struct<'a, T, U> @@ -789,6 +819,7 @@ pub mod explicit_outlives_requirements { /// Testing tuple struct. #[allow(explicit_outlives_requirements)] // for the type itself: https://github.com/rust-lang/rust/issues/60993 + #[allow(clippy::exhaustive_structs, clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct TupleStruct<'a, T, U>(#[pin] pub &'a mut T, pub &'a mut U) @@ -798,6 +829,7 @@ pub mod explicit_outlives_requirements { /// Testing enum. #[allow(explicit_outlives_requirements)] // for the type itself: https://github.com/rust-lang/rust/issues/60993 + #[allow(clippy::exhaustive_enums, clippy::single_char_lifetime_names)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -833,6 +865,7 @@ pub mod explicit_outlives_requirements { () => { /// Testing struct. #[allow(explicit_outlives_requirements)] // for the type itself: https://github.com/rust-lang/rust/issues/60993 + #[allow(clippy::exhaustive_structs, clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct Struct<'a, T, U> @@ -849,6 +882,7 @@ pub mod explicit_outlives_requirements { /// Testing tuple struct. #[allow(explicit_outlives_requirements)] // for the type itself: https://github.com/rust-lang/rust/issues/60993 + #[allow(clippy::exhaustive_structs, clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct TupleStruct<'a, T, U>(#[pin] pub &'a mut T, pub &'a mut U) @@ -858,6 +892,7 @@ pub mod explicit_outlives_requirements { /// Testing enum. #[allow(explicit_outlives_requirements)] // for the type itself: https://github.com/rust-lang/rust/issues/60993 + #[allow(clippy::exhaustive_enums, clippy::single_char_lifetime_names)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -896,6 +931,7 @@ pub mod single_use_lifetimes { /// Testing trait. #[allow(unused_lifetimes)] + #[allow(clippy::single_char_lifetime_names)] // for the type itself pub trait Trait<'a> {} /// Testing HRTB. @@ -923,6 +959,7 @@ pub mod single_use_lifetimes { () => { /// Testing trait. #[allow(unused_lifetimes)] + #[allow(clippy::single_char_lifetime_names)] // for the type itself pub trait Trait<'a> {} /// Testing HRTB. @@ -952,8 +989,7 @@ pub mod variant_size_differences { /// Testing enum. #[allow(missing_debug_implementations, missing_copy_implementations)] // https://github.com/rust-lang/rust/pull/74060 - #[allow(variant_size_differences)] // for the type itself - #[allow(clippy::large_enum_variant)] // for the type itself + #[allow(variant_size_differences, clippy::exhaustive_enums, clippy::large_enum_variant)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -976,8 +1012,7 @@ pub mod variant_size_differences { () => { /// Testing enum. #[allow(missing_debug_implementations, missing_copy_implementations)] // https://github.com/rust-lang/rust/pull/74060 - #[allow(variant_size_differences)] // for the type itself - #[allow(clippy::large_enum_variant)] // for the type itself + #[allow(variant_size_differences, clippy::exhaustive_enums, clippy::large_enum_variant)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -1001,6 +1036,7 @@ pub mod clippy_mut_mut { use pin_project::pin_project; /// Testing struct. + #[allow(clippy::exhaustive_structs, clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct Struct<'a, T, U> { @@ -1012,11 +1048,13 @@ pub mod clippy_mut_mut { } /// Testing tuple struct. + #[allow(clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct TupleStruct<'a, T, U>(#[pin] &'a mut T, &'a mut U); /// Testing enum. + #[allow(clippy::exhaustive_enums, clippy::single_char_lifetime_names)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -1047,6 +1085,7 @@ pub mod clippy_mut_mut { macro_rules! mac { () => { /// Testing struct. + #[allow(clippy::exhaustive_structs, clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct Struct<'a, T, U> { @@ -1058,11 +1097,13 @@ pub mod clippy_mut_mut { } /// Testing tuple struct. + #[allow(clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project_replace)] #[derive(Debug)] pub struct TupleStruct<'a, T, U>(#[pin] &'a mut T, &'a mut U); /// Testing enum. + #[allow(clippy::exhaustive_enums, clippy::single_char_lifetime_names)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -1190,6 +1231,7 @@ pub mod clippy_type_repetition_in_bounds { /// Testing struct. #[pin_project(project_replace)] + #[allow(clippy::exhaustive_structs)] // for the type itself pub struct Struct where Self: Sized, @@ -1208,6 +1250,7 @@ pub mod clippy_type_repetition_in_bounds { Self: Sized; /// Testing enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -1240,6 +1283,7 @@ pub mod clippy_type_repetition_in_bounds { macro_rules! mac { () => { /// Testing struct. + #[allow(clippy::exhaustive_structs)] // for the type itself #[pin_project(project_replace)] pub struct Struct where @@ -1259,6 +1303,7 @@ pub mod clippy_type_repetition_in_bounds { Self: Sized; /// Testing enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -1341,7 +1386,7 @@ pub mod clippy_used_underscore_binding { use pin_project::pin_project; /// Testing struct. - #[allow(clippy::pub_underscore_fields)] + #[allow(clippy::exhaustive_structs, clippy::pub_underscore_fields)] // for the type itself #[pin_project(project_replace)] pub struct Struct { /// Pinned field. @@ -1352,6 +1397,7 @@ pub mod clippy_used_underscore_binding { } /// Testing enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -1377,7 +1423,7 @@ pub mod clippy_used_underscore_binding { macro_rules! mac { () => { /// Testing struct. - #[allow(clippy::pub_underscore_fields)] + #[allow(clippy::exhaustive_structs, clippy::pub_underscore_fields)] // for the type itself #[pin_project(project_replace)] pub struct Struct { /// Pinned field. @@ -1388,6 +1434,7 @@ pub mod clippy_used_underscore_binding { } /// Testing enum. + #[allow(clippy::exhaustive_enums)] // for the type itself #[pin_project( project = EnumProj, project_ref = EnumProjRef, @@ -1416,7 +1463,11 @@ pub mod clippy_ref_option_ref { use pin_project::pin_project; /// Testing struct. - #[allow(clippy::pub_underscore_fields)] + #[allow( + clippy::exhaustive_structs, + clippy::pub_underscore_fields, + clippy::single_char_lifetime_names + )] // for the type itself #[pin_project] pub struct Struct<'a> { /// Pinned field. @@ -1427,6 +1478,7 @@ pub mod clippy_ref_option_ref { } /// Testing enum. + #[allow(clippy::exhaustive_enums, clippy::single_char_lifetime_names)] // for the type itself #[pin_project(project = EnumProj, project_ref = EnumProjRef)] pub enum Enum<'a> { /// Variant.