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