| 1 | use ghost::phantom; |
| 2 | |
| 3 | #[phantom] |
| 4 | struct MyPhantom<T: ?Sized>; |
| 5 | |
| 6 | fn require_send<T: Send>() {} |
| 7 | fn require_sync<T: Sync>() {} |
| 8 | |
| 9 | fn main() { |
| 10 | // ok |
| 11 | require_send::<MyPhantom<u8>>(); |
| 12 | require_sync::<MyPhantom<u8>>(); |
| 13 | |
| 14 | // not ok |
| 15 | require_send::<MyPhantom<*const u8>>(); |
| 16 | require_sync::<MyPhantom<*const u8>>(); |
| 17 | } |