You can coerce from subtypes to supertypes. So a &'long T
is a subtype of &'short T
.
Lifetime aren't types so it's all a bit of an abuse of terminology when we talk about their "subtypes". You actually have a choice between putting 'static
at the top or the bottom of the hierarchy. So we could have said that the 'a
in &'a T
is contravariant -- and in fact, we use to! -- in which case shorter lifetimes are "subs" of longer lifetimes and 'static
is at the top (and there is no bottom).
But (today) the terminology that has been settled on is to call it covariant. With that covariant terminology, the longer lifetime must be a "sub" of the shorter lifetime, and 'static
is the bottom of the hierarchy (and there is no top).
Which is confusing to many. (But I guess having "contra" so prevalent was also confusing.)