mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
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.
|
||||
|
||||
// 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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user