• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: Apache-2.0 OR MIT
2 
3 // Note: If you change this test, change 'overlapping_marker_traits.rs' at the same time.
4 
5 use std::marker::PhantomPinned;
6 
7 use pin_project::pin_project;
8 
9 #[pin_project] //~ ERROR E0119
10 struct Struct<T> {
11     #[pin]
12     f: T,
13 }
14 
15 // unsound Unpin impl
16 impl<T> Unpin for Struct<T> {}
17 
is_unpin<T: Unpin>()18 fn is_unpin<T: Unpin>() {}
19 
main()20 fn main() {
21     is_unpin::<Struct<PhantomPinned>>()
22 }
23