Skip to content

Commit ce08025

Browse files
committed
Remove mention of contravariance possibly getting scrapped
Contravariance is part of stable Rust, and it's a natural outcome of how `fn(T)` interacts with lifetimes, so it's hard to imagine this ever going away. tl;dr: LONG LIVE CONTRAVARIANCE!
1 parent 8be35b2 commit ce08025

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/phantom-data.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ Here’s a table of all the wonderful ways `PhantomData` could be used:
9696
| `PhantomData<&'a mut T>` | variant | invariant |
9797
| `PhantomData<*const T>` | - | variant |
9898
| `PhantomData<*mut T>` | - | invariant |
99-
| `PhantomData<fn(T)>` | - | contravariant (*) |
99+
| `PhantomData<fn(T)>` | - | contravariant |
100100
| `PhantomData<fn() -> T>` | - | variant |
101101
| `PhantomData<fn(T) -> T>` | - | invariant |
102102
| `PhantomData<Cell<&'a ()>>` | invariant | - |
103-
104-
(*) If contravariance gets scrapped, this would be invariant.

0 commit comments

Comments
 (0)