You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To work around the parameter T is never used [E0392] error, one if often suggested to use PhantomData.
However, the documentation of PhantomData explains that various forms are possible, but is quite vague about the consequences of the choice of a form (and also only handles a small subset of the possible forms).
From my understanding given this reddit thread I opened these various forms can have different consequences (regarding dopck and/or lifetime variance ?):
PhantomData<T>
PhantomData<&'a T>
PhantomData<&'a mut T>
PhantomData<*const T>
PhantomData<*mut T>
PhantomData<fn(T) -> ()>
PhantomData<fn() -> T>
PhantomData<fn(T) -> T>
But I have no real idea about what using one or another changes.