Skip to content

Commit 4f16e51

Browse files
committed
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 :)
2 parents d324917 + 266b7e0 commit 4f16e51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/compile-fail/regions-variance-contravariant-use-covariant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// variance inference works in the first place.
1616

1717
// This is contravariant with respect to 'a, meaning that
18-
// Contravariant<'foo> <: Contravariant<'static> because
19-
// 'foo <= 'static
18+
// Contravariant<'long> <: Contravariant<'short> iff
19+
// 'short <= 'long
2020
struct Contravariant<'a> {
2121
f: &'a int
2222
}

0 commit comments

Comments
 (0)