-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Update nomicon for variance typo & contravariance #30332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
&'b mut B was described incorrectly (just in this example, is correct in the actual text).
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
This updates nomicon to just mention contravariance without having a longer explanation. I will cast my own doubts on contravariance for fn() to be removed, since it will mean some valid trait implementations will stop compiling. It's a simple change for a parenthesis sentence, but I'll ping the language team anyway (sorry!) cc @rust-lang/lang |
for functions. The future of contravariance is uncertain and it may be | ||
scrapped. For now, `fn(T)` is contravariant in `T`, which is used in matching | ||
methods in trait implementations to the trait definition. Traits are | ||
not covariant in their parameters, so `Fn(T)`, is invariant in `T`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not contravariant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, fixed.
d215a09
to
f9d029b
Compare
@bors r+ rollup Needs work, but a clear improvement. |
📌 Commit f9d029b has been approved by |
for functions. The future of contravariance is uncertain and it may be | ||
scrapped. For now, `fn(T)` is contravariant in `T`, which is used in matching | ||
methods in trait implementations to the trait definition. Traits don't have | ||
inferred variance, so `Fn(T)`, is invariant in `T`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fn(T)
,
extra comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reading!
⌛ Testing commit f9d029b with merge 671afce... |
💔 Test failed - auto-mac-64-opt |
f9d029b
to
2a30f0e
Compare
Fixed the comma, and let's see if bors can test this @bors r=gankro rollup |
📌 Commit 2a30f0e has been approved by |
⌛ Testing commit 2a30f0e with merge d538aa2... |
💔 Test failed - auto-mac-64-opt |
@bors: retry On Sat, Dec 12, 2015 at 12:19 AM, bors notifications@github.com wrote:
|
Update nomicon for variance typo & contravariance
Fixes #28704
Fixes #28100