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:
bors 2014-02-10 08:16:35 -08:00
commit 4f16e519f1

View File

@ -15,8 +15,8 @@
// variance inference works in the first place.
// This is contravariant with respect to 'a, meaning that
// Contravariant<'foo> <: Contravariant<'static> because
// 'foo <= 'static
// Contravariant<'long> <: Contravariant<'short> iff
// 'short <= 'long
struct Contravariant<'a> {
f: &'a int
}