pull/231/head
Hu Shuai 4 years ago committed by GitHub
parent bfe1ab96d7
commit b5d7df3c9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -91,12 +91,12 @@ Heres a table of all the wonderful ways `PhantomData` could be used:
| Phantom type | `'a` | `T` |
|-----------------------------|-----------|---------------------------|
| `PhantomData<T>` | - | variant (with drop check) |
| `PhantomData<&'a T>` | variant | variant |
| `PhantomData<&'a mut T>` | variant | invariant |
| `PhantomData<*const T>` | - | variant |
| `PhantomData<T>` | - | covariant (with drop check) |
| `PhantomData<&'a T>` | covariant | covariant |
| `PhantomData<&'a mut T>` | covariant | invariant |
| `PhantomData<*const T>` | - | covariant |
| `PhantomData<*mut T>` | - | invariant |
| `PhantomData<fn(T)>` | - | contravariant |
| `PhantomData<fn() -> T>` | - | variant |
| `PhantomData<fn() -> T>` | - | covariant |
| `PhantomData<fn(T) -> T>` | - | invariant |
| `PhantomData<Cell<&'a ()>>` | invariant | - |

Loading…
Cancel
Save