I was browsing some libraries and I noticed the usage of a struct containing a phantom lifetime field, like
struct S<'a> {
s: i32,
_lifetime: PhantomData<&'a ()> // NOTE: there's no generic type here!
}
I'm curious to know the significance of the phantom lifetime — what advantages does it provide for S
and that without it would not be possible or not convenient to deal with?