Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustvariance co contra invariantSingle-choice MCQ

Consider `fn foo<'a>(f: fn(&'a str) -> bool)`. With respect to `'a`, the function-pointer type `fn(&'a str) -> bool` is variant in which direction, given that `'a` appears only in the argument position?

type F<'a> = fn(&'a str) -> bool;