In the Nomicon's section about subtyping, it says contravariance is available for a function pointer type. However, I can't find any good examples of this. I tried to code a struct with a function pointer, but the contravariance doesn't seem to work.
What is a code example of this?
Rust's notion of subtyping only applies to lifetimes.
Searching for the term "contra" on the page you linked has numerous relevant paragraphs:
The page ends with an example of all the types of contravariance. Applying it...
Contravariance
The contravariant example does not allow substituting
'static
for'short
:Covariance
The covariant example does not allow substituting
'short
for'static
: