This struct compiles fine:
struct S<'a, T: ?Sized, U: ?Sized> {
x: Pin<&'a mut T>,
y: Pin<&'a mut U>,
}
However, the moment I add #[pin_project]
in front of it, it fails, complaining that T
needs to be Sized
. I don’t understand why. S
doesn’t have a T
in it. None of the projections of S
, as far as I can tell, should have T
s in them either (they should only have various kinds of pointers to T
s). Curiously, if T
is Sized
and U
is ?Sized
, pin-project is perfectly happy. Also, even if I change the order of the fields, pin-project still complains about T
and not U
!
What’s going on here?