| 1 | use ghost::phantom; |
| 2 | |
| 3 | #[phantom] |
| 4 | struct CovariantPhantom<T>; |
| 5 | |
| 6 | fn require_covariant<'a>(phantom: CovariantPhantom<&'static str>) -> CovariantPhantom<&'a str> { |
| 7 | phantom |
| 8 | } |
| 9 | |
| 10 | fn require_contravariant<'a>(phantom: CovariantPhantom<&'a str>) -> CovariantPhantom<&'static str> { |
| 11 | phantom |
| 12 | } |
| 13 | |
| 14 | fn main() {} |