diff options
Diffstat (limited to 'tests/ui/unsafe_unpin/proper_unpin.rs')
-rw-r--r-- | tests/ui/unsafe_unpin/proper_unpin.rs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/ui/unsafe_unpin/proper_unpin.rs b/tests/ui/unsafe_unpin/proper_unpin.rs deleted file mode 100644 index 6573aec..0000000 --- a/tests/ui/unsafe_unpin/proper_unpin.rs +++ /dev/null @@ -1,41 +0,0 @@ -use pin_project::{pin_project, UnsafeUnpin}; -use std::marker::PhantomPinned; - -fn is_unpin<T: Unpin>() {} - -#[pin_project(UnsafeUnpin)] -struct Blah<T, U> { - field1: U, - #[pin] - field2: T, -} - -unsafe impl<T: Unpin, U> UnsafeUnpin for Blah<T, U> {} - -#[pin_project(UnsafeUnpin)] -struct TrivialBounds { - #[pin] - field1: PhantomPinned, -} - -#[pin_project(UnsafeUnpin)] -struct OverlappingLifetimeNames<'pin, T, U> { - #[pin] - field1: U, - #[pin] - field2: Option<T>, - field3: &'pin (), -} - -unsafe impl<T: Unpin, U: Unpin> UnsafeUnpin for OverlappingLifetimeNames<'_, T, U> {} - -fn main() { - is_unpin::<Blah<PhantomPinned, ()>>(); //~ ERROR E0277 - is_unpin::<Blah<(), PhantomPinned>>(); // Ok - is_unpin::<Blah<PhantomPinned, PhantomPinned>>(); //~ ERROR E0277 - - is_unpin::<TrivialBounds>(); //~ ERROR E0277 - - is_unpin::<OverlappingLifetimeNames<'_, PhantomPinned, ()>>(); //~ ERROR E0277 - is_unpin::<OverlappingLifetimeNames<'_, (), PhantomPinned>>(); //~ ERROR E0277 -} |