Skip to content

Commit

Permalink
Move lint test to sub-crate
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jan 25, 2024
1 parent 75fa3f7 commit 5bc8a1a
Show file tree
Hide file tree
Showing 37 changed files with 434 additions and 5 deletions.
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
2 changes: 2 additions & 0 deletions pin-project-internal/src/pin_project/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ fn proj_allowed_lints(cx: &Context<'_>) -> (TokenStream, TokenStream, TokenStrea
#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 };
Expand Down Expand Up @@ -856,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
1 change: 1 addition & 0 deletions tests/expand/default/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,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
1 change: 1 addition & 0 deletions tests/expand/default/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,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
1 change: 1 addition & 0 deletions tests/expand/default/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,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
1 change: 1 addition & 0 deletions tests/expand/multifields/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,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
1 change: 1 addition & 0 deletions tests/expand/multifields/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,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 Down
1 change: 1 addition & 0 deletions tests/expand/multifields/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,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 Down
1 change: 1 addition & 0 deletions tests/expand/naming/enum-all.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,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 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
1 change: 1 addition & 0 deletions tests/expand/naming/struct-all.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,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 Down
1 change: 1 addition & 0 deletions tests/expand/naming/struct-mut.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,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
1 change: 1 addition & 0 deletions tests/expand/naming/struct-none.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,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
1 change: 1 addition & 0 deletions tests/expand/naming/struct-own.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,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
1 change: 1 addition & 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 Down
1 change: 1 addition & 0 deletions tests/expand/naming/tuple_struct-all.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,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 Down
1 change: 1 addition & 0 deletions tests/expand/naming/tuple_struct-mut.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,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
1 change: 1 addition & 0 deletions tests/expand/naming/tuple_struct-none.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,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
1 change: 1 addition & 0 deletions tests/expand/naming/tuple_struct-own.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,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
1 change: 1 addition & 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 Down
1 change: 1 addition & 0 deletions tests/expand/not_unpin/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,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
1 change: 1 addition & 0 deletions tests/expand/not_unpin/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,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
1 change: 1 addition & 0 deletions tests/expand/not_unpin/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,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
2 changes: 2 additions & 0 deletions tests/expand/pinned_drop/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,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 @@ -138,6 +139,7 @@ const _: () = {
__Enum<'pin, T, U>: _pin_project::__private::Unpin,
{}
impl<T, U> _pin_project::__private::Drop for Enum<T, U> {
#[allow(clippy::missing_inline_in_public_items)]
fn drop(&mut self) {
unsafe {
let __pinned_self = _pin_project::__private::Pin::new_unchecked(self);
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/pinned_drop/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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 Expand Up @@ -97,6 +98,7 @@ const _: () = {
__Struct<'pin, T, U>: _pin_project::__private::Unpin,
{}
impl<T, U> _pin_project::__private::Drop for Struct<T, U> {
#[allow(clippy::missing_inline_in_public_items)]
fn drop(&mut self) {
unsafe {
let __pinned_self = _pin_project::__private::Pin::new_unchecked(self);
Expand Down
2 changes: 2 additions & 0 deletions tests/expand/pinned_drop/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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 Expand Up @@ -91,6 +92,7 @@ const _: () = {
__TupleStruct<'pin, T, U>: _pin_project::__private::Unpin,
{}
impl<T, U> _pin_project::__private::Drop for TupleStruct<T, U> {
#[allow(clippy::missing_inline_in_public_items)]
fn drop(&mut self) {
unsafe {
let __pinned_self = _pin_project::__private::Pin::new_unchecked(self);
Expand Down
1 change: 1 addition & 0 deletions tests/expand/project_replace/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,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
1 change: 1 addition & 0 deletions tests/expand/project_replace/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,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
1 change: 1 addition & 0 deletions tests/expand/pub/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,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)]
pub(crate) enum EnumProjRef<'pin, T, U>
where
Enum<T, U>: 'pin,
Expand Down
1 change: 1 addition & 0 deletions tests/expand/pub/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const _: () = {
}
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
pub(crate) struct __StructProjectionRef<'pin, T, U>
where
Struct<T, U>: 'pin,
Expand Down
1 change: 1 addition & 0 deletions tests/expand/pub/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const _: () = {
TupleStruct<T, U>: 'pin;
#[allow(dead_code)]
#[allow(clippy::ref_option_ref)]
#[allow(clippy::missing_docs_in_private_items)]
pub(crate) struct __TupleStructProjectionRef<'pin, T, U>(
pub ::pin_project::__private::Pin<&'pin (T)>,
pub &'pin (U),
Expand Down
1 change: 1 addition & 0 deletions tests/expand/unsafe_unpin/enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,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
1 change: 1 addition & 0 deletions tests/expand/unsafe_unpin/struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,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
1 change: 1 addition & 0 deletions tests/expand/unsafe_unpin/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,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
Loading

0 comments on commit 5bc8a1a

Please sign in to comment.