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

Given `struct Foo<'a> { f: fn(&'a str) }` versus `struct Bar<'a> { f: fn() -> &'a str }`, how does the variance of `'a` differ between `Foo` and `Bar`?

struct Foo<'a> { f: fn(&'a str) } struct Bar<'a> { f: fn() -> &'a str }