1 // NB: If you change this test, change 'marker_trait_attr-feature-gate.rs' at the same time.
2 
3 // marker_trait_attr
4 // Tracking issue: https://github.com/rust-lang/rust/issues/29864
5 #![feature(marker_trait_attr)]
6 
7 // See https://github.com/taiki-e/pin-project/issues/105#issuecomment-535355974
8 
9 use pin_project::pin_project;
10 use std::marker::PhantomPinned;
11 
12 #[pin_project] //~ ERROR E0119
13 struct Struct<T> {
14     #[pin]
15     x: T,
16 }
17 
18 // unsound Unpin impl
19 impl<T> Unpin for Struct<T> {}
20 
is_unpin<T: Unpin>()21 fn is_unpin<T: Unpin>() {}
22 
main()23 fn main() {
24     is_unpin::<Struct<PhantomPinned>>()
25 }
26