Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/src/pin_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1792,13 +1792,13 @@ fn generate_projections(info: &StructInfo) -> TokenStream {
#[doc = #docs]
// Allow `non_snake_case` since the same warning will be emitted on
// the struct definition.
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
#projection_lt_def

// Allow `non_snake_case` since the same warning will be emitted on
// the struct definition.
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
#projection_ref_lt_def

Expand Down Expand Up @@ -2000,7 +2000,7 @@ fn generate_the_pin_data(info: &StructInfo) -> TokenStream {
quote! {
// We declare this struct which will host all of the projection function for our type.
#[doc(hidden)]
#[allow(non_snake_case)]
#[allow(non_snake_case, explicit_outlives_requirements)]
#vis struct __PinDataLt #generics_with_field_lt
#whr_with_field_lt
{
Expand Down
15 changes: 15 additions & 0 deletions tests/explicit_outlives_requirements.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#![deny(explicit_outlives_requirements)]

use pin_init::*;

#[pin_data]
struct ComplexCapture<'bound> {
#[uses('gpu: invariant)]
part: &'gpu (),
gpu: &'bar1 (),
#[borrowed]
bar1: &'bound (),
bar: &'bound (),
}

fn main() {}
6 changes: 3 additions & 3 deletions tests/ui/expand/many_generics.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const _: () = {
__this: ::core::marker::PhantomData<&'__this mut Foo<'a, 'b, T, SIZE>>,
}
/// Pin-projections of [`Foo`]
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionLt<
'__this,
Expand All @@ -51,7 +51,7 @@ const _: () = {
&'__this mut Foo<'a, 'b, T, SIZE>,
>,
}
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionRef<
'__this,
Expand Down Expand Up @@ -136,7 +136,7 @@ const _: () = {
}
}
#[doc(hidden)]
#[allow(non_snake_case)]
#[allow(non_snake_case, explicit_outlives_requirements)]
struct __PinDataLt<'a, 'b: 'a, T: Bar<'b> + ?Sized + 'a, const SIZE: usize = 0>
where
T: Bar<'a, 1>,
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/expand/pin-data.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ const _: () = {
__this: ::core::marker::PhantomData<&'__this mut Foo>,
}
/// Pin-projections of [`Foo`]
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionLt<'__this> {
array: &'__this mut [u8; 1024 * 1024],
_pin: ::core::pin::Pin<&'__this mut PhantomPinned>,
___pin_phantom_data: ::core::marker::PhantomData<&'__this mut Foo>,
}
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionRef<'__this> {
array: &'__this [u8; 1024 * 1024],
Expand Down Expand Up @@ -87,7 +87,7 @@ const _: () = {
}
}
#[doc(hidden)]
#[allow(non_snake_case)]
#[allow(non_snake_case, explicit_outlives_requirements)]
struct __PinDataLt {
array: ::pin_init::__internal::PhantomInvariant<[u8; 1024 * 1024]>,
_pin: ::pin_init::__internal::PhantomInvariant<PhantomPinned>,
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/expand/pinned_drop.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ const _: () = {
__this: ::core::marker::PhantomData<&'__this mut Foo>,
}
/// Pin-projections of [`Foo`]
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionLt<'__this> {
array: &'__this mut [u8; 1024 * 1024],
_pin: ::core::pin::Pin<&'__this mut PhantomPinned>,
___pin_phantom_data: ::core::marker::PhantomData<&'__this mut Foo>,
}
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionRef<'__this> {
array: &'__this [u8; 1024 * 1024],
Expand Down Expand Up @@ -87,7 +87,7 @@ const _: () = {
}
}
#[doc(hidden)]
#[allow(non_snake_case)]
#[allow(non_snake_case, explicit_outlives_requirements)]
struct __PinDataLt {
array: ::pin_init::__internal::PhantomInvariant<[u8; 1024 * 1024]>,
_pin: ::pin_init::__internal::PhantomInvariant<PhantomPinned>,
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/expand/tuple_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ const _: () = {
::core::marker::PhantomData<&'__this mut Foo<'a, T, N>>,
);
/// Pin-projections of [`Foo`]
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionLt<'__this, 'a, T: Copy, const N: usize>(
&'__this mut &'a mut [T; N],
::core::pin::Pin<&'__this mut PhantomPinned>,
&'__this mut usize,
::core::marker::PhantomData<&'__this mut Foo<'a, T, N>>,
);
#[allow(dead_code, non_snake_case)]
#[allow(dead_code, non_snake_case, explicit_outlives_requirements)]
#[doc(hidden)]
struct __ProjectionRef<'__this, 'a, T: Copy, const N: usize>(
&'__this &'a mut [T; N],
Expand Down Expand Up @@ -97,7 +97,7 @@ const _: () = {
}
}
#[doc(hidden)]
#[allow(non_snake_case)]
#[allow(non_snake_case, explicit_outlives_requirements)]
struct __PinDataLt<'a, T: Copy, const N: usize> {
_0: ::pin_init::__internal::PhantomInvariant<&'a mut [T; N]>,
_1: ::pin_init::__internal::PhantomInvariant<PhantomPinned>,
Expand Down
Loading