You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a hard time trying to understand variance in function arguments in the following chapter:
However, the same logic does not apply to arguments. Consider trying to satisfy:
fnhandle_animal(Animal);
with:
fnhandle_animal(Cat);
The first function can accept Dogs, but the second function absolutely can't.
Covariance doesn't work here. But if we flip it around, it actually does
work! If we need a function that can handle Cats, a function that can handle any
Animal will surely work fine. Or to relate it back to real Rust: if we need a
function that can handle anything that lives for at least 'long, it's perfectly
fine for it to be able to handle anything that lives for at least 'short.
The most confusing thing is what does it mean to "satisfy one function with the other"?
I'd suggest to rewrite this paragraph
The text was updated successfully, but these errors were encountered:
I read the example today as well and through about fleshing it out a little bit but I do not want to get into anyone's way. @andronov-alexey do you want to work on this and just wait for a thumbs-up from a maintainer, or did you just want to bring it up?
I have a hard time trying to understand variance in function arguments in the following chapter:
The most confusing thing is what does it mean to "satisfy one function with the other"?
I'd suggest to rewrite this paragraph
The text was updated successfully, but these errors were encountered: