auto merge of #12150 : jakerr/rust/patch-1, r=pnkfelix
The current comment actually describes *co*-variance. Fixing this to describe contravariance while keeping 'static in the definition was tricky so just changed to use 'short and 'long. I found the typo in my attempt to understand the concept of variance itself and the comment confused me. I mention this to point out that I'm new to the concept so may have still got the definition wrong, so please review with care :)
This commit is contained in:
commit
4f16e519f1
|
@ -15,8 +15,8 @@
|
||||||
// variance inference works in the first place.
|
// variance inference works in the first place.
|
||||||
|
|
||||||
// This is contravariant with respect to 'a, meaning that
|
// This is contravariant with respect to 'a, meaning that
|
||||||
// Contravariant<'foo> <: Contravariant<'static> because
|
// Contravariant<'long> <: Contravariant<'short> iff
|
||||||
// 'foo <= 'static
|
// 'short <= 'long
|
||||||
struct Contravariant<'a> {
|
struct Contravariant<'a> {
|
||||||
f: &'a int
|
f: &'a int
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue