Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allow(clippy::missing_docs_in_private_items) #356

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ members = [
"tests/auxiliary/macro",
"tests/no-core",
"tests/no-std",
"tests/lint",
"tests/rust-2015",
]

Expand Down
4 changes: 4 additions & 0 deletions pin-project-internal/src/pin_project/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,21 @@ fn proj_allowed_lints(cx: &Context<'_>) -> (TokenStream, TokenStream, TokenStrea
#proj_mut_allowed_lints
#[allow(dead_code)] // This lint warns unused fields/variants.
#[allow(clippy::mut_mut)] // This lint warns `&mut &mut <ty>`.
#[allow(clippy::missing_docs_in_private_items)]
daxpedda marked this conversation as resolved.
Show resolved Hide resolved
};
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<&<ty>>`.
#[allow(clippy::missing_docs_in_private_items)]
};
let proj_own_allowed_lints =
if cx.project_replace.ident().is_some() { Some(&global_allowed_lints) } 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
};
(proj_mut, proj_ref, proj_own)
Expand Down Expand Up @@ -854,6 +857,7 @@ fn make_drop_impl(cx: &Context<'_>) -> TokenStream {
impl #impl_generics _pin_project::__private::Drop for #ident #ty_generics
#where_clause
{
#[allow(clippy::missing_inline_in_public_items)]
fn drop(&mut self) {
#unsafety {
// Safety - we're in 'drop', so we know that 'self' will
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/default/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum Enum<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
enum EnumProj<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand All @@ -40,6 +41,7 @@ where
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
enum EnumProjRef<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/default/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjection<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -33,6 +34,7 @@ const _: () = {
}
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjectionRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/default/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjection<'pin, T, U>(
::pin_project::__private::Pin<&'pin mut (T)>,
&'pin mut (U),
Expand All @@ -28,6 +29,7 @@ const _: () = {
TupleStruct<T, U>: 'pin;
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjectionRef<'pin, T, U>(
::pin_project::__private::Pin<&'pin (T)>,
&'pin (U),
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/multifields/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enum Enum<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
enum EnumProj<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand Down Expand Up @@ -53,6 +54,7 @@ where
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
enum EnumProjRef<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand Down Expand Up @@ -82,6 +84,7 @@ where
#[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)]
enum EnumProjOwn<T, U> {
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/multifields/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjection<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -38,6 +39,7 @@ const _: () = {
}
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjectionRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -48,6 +50,7 @@ const _: () = {
unpinned2: &'pin (U),
}
#[allow(dead_code)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjectionOwned<T, U> {
pinned1: ::pin_project::__private::PhantomData<T>,
pinned2: ::pin_project::__private::PhantomData<T>,
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/multifields/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjection<'pin, T, U>(
::pin_project::__private::Pin<&'pin mut (T)>,
::pin_project::__private::Pin<&'pin mut (T)>,
Expand All @@ -30,6 +31,7 @@ const _: () = {
TupleStruct<T, U>: 'pin;
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjectionRef<'pin, T, U>(
::pin_project::__private::Pin<&'pin (T)>,
::pin_project::__private::Pin<&'pin (T)>,
Expand All @@ -39,6 +41,7 @@ const _: () = {
where
TupleStruct<T, U>: 'pin;
#[allow(dead_code)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjectionOwned<T, U>(
::pin_project::__private::PhantomData<T>,
::pin_project::__private::PhantomData<T>,
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/naming/enum-all.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum Enum<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
enum Proj<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand All @@ -40,6 +41,7 @@ where
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
enum ProjRef<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand All @@ -59,6 +61,7 @@ where
#[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)]
enum ProjOwn<T, U> {
Expand Down
1 change: 1 addition & 0 deletions tests/expand/naming/enum-mut.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum Enum<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
enum Proj<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand Down
1 change: 1 addition & 0 deletions tests/expand/naming/enum-own.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum Enum<T, U> {
#[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)]
enum ProjOwn<T, U> {
Expand Down
1 change: 1 addition & 0 deletions tests/expand/naming/enum-ref.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum Enum<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
enum ProjRef<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/naming/struct-all.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct Struct<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct Proj<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -36,6 +37,7 @@ where
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -54,6 +56,7 @@ where
#[allow(clippy::redundant_pub_crate)]
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjOwn<T, U> {
pinned: ::pin_project::__private::PhantomData<T>,
unpinned: U,
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/naming/struct-mut.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct Struct<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct Proj<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -43,6 +44,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjectionRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/naming/struct-none.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjection<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -33,6 +34,7 @@ const _: () = {
}
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjectionRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/naming/struct-own.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct Struct<T, U> {
#[allow(clippy::redundant_pub_crate)]
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjOwn<T, U> {
pinned: ::pin_project::__private::PhantomData<T>,
unpinned: U,
Expand All @@ -39,6 +40,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjection<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -48,6 +50,7 @@ const _: () = {
}
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjectionRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/naming/struct-ref.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct Struct<T, U> {
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand All @@ -43,6 +44,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __StructProjection<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/naming/tuple_struct-all.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct Proj<'pin, T, U>(
::pin_project::__private::Pin<&'pin mut (T)>,
&'pin mut (U),
Expand All @@ -31,6 +32,7 @@ where
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjRef<'pin, T, U>(
::pin_project::__private::Pin<&'pin (T)>,
&'pin (U),
Expand All @@ -48,6 +50,7 @@ where
#[allow(clippy::redundant_pub_crate)]
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U);
#[allow(box_pointers)]
#[allow(deprecated)]
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/naming/tuple_struct-mut.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct Proj<'pin, T, U>(
::pin_project::__private::Pin<&'pin mut (T)>,
&'pin mut (U),
Expand All @@ -38,6 +39,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjectionRef<'pin, T, U>(
::pin_project::__private::Pin<&'pin (T)>,
&'pin (U),
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/naming/tuple_struct-none.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjection<'pin, T, U>(
::pin_project::__private::Pin<&'pin mut (T)>,
&'pin mut (U),
Expand All @@ -28,6 +29,7 @@ const _: () = {
TupleStruct<T, U>: 'pin;
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjectionRef<'pin, T, U>(
::pin_project::__private::Pin<&'pin (T)>,
&'pin (U),
Expand Down
3 changes: 3 additions & 0 deletions tests/expand/naming/tuple_struct-own.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
#[allow(clippy::redundant_pub_crate)]
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U);
#[allow(box_pointers)]
#[allow(deprecated)]
Expand All @@ -32,6 +33,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjection<'pin, T, U>(
::pin_project::__private::Pin<&'pin mut (T)>,
&'pin mut (U),
Expand All @@ -40,6 +42,7 @@ const _: () = {
TupleStruct<T, U>: 'pin;
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjectionRef<'pin, T, U>(
::pin_project::__private::Pin<&'pin (T)>,
&'pin (U),
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/naming/tuple_struct-ref.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
#[allow(clippy::type_repetition_in_bounds)]
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
struct ProjRef<'pin, T, U>(
::pin_project::__private::Pin<&'pin (T)>,
&'pin (U),
Expand All @@ -38,6 +39,7 @@ const _: () = {
extern crate pin_project as _pin_project;
#[allow(dead_code)]
#[allow(clippy::mut_mut)]
#[allow(clippy::missing_docs_in_private_items)]
struct __TupleStructProjection<'pin, T, U>(
::pin_project::__private::Pin<&'pin mut (T)>,
&'pin mut (U),
Expand Down