-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Audit traits and (partially) trait objects sections of Reference #25308
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
dispatched using _virtual method tables_ ("vtables"). Whereas most calls to | ||
trait methods are "early bound" (statically resolved) to specific | ||
implementations at compile time, a call to a method on an trait objects is | ||
only resolved to a vtable entry at compile time. The actual |
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.
This sentence threw me for a bit of a spin, I think the grammar around "on an trait objects is" may need to be updated slightly, but it was a little odd talking about late bindings, then early bindings, then back to late bindings. Perhaps this could be restructured a bit?
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.
I've made an attempt at improving this.
Thanks for the edits! I think there's an interesting balance in the reference manual between defining what you can do as well as being a bit tutorial-like (because the book I believe also covers much of this material), but I think the updates here are fine regardless. |
Same. |
☔ The latest upstream changes (presumably #25340) made this pull request unmergeable. Please resolve the merge conflicts. |
@nham this still can't merge, would you mind rebasing? |
@steveklabnik On it. The issue I'm seeing now is that @nikomatsakis made big changes to the "Traits" section as well, and in looking over his changes I'm now confused about the terminology here. My reading of Niko's changes is that:
This doesn't seem to be consistent with @alexcrichton's suggestion that "associated function" is the new name for a static method. |
@steveklabnik I've rebased now. |
I don't particularly like the term "static method" -- if I used it, it was unintentional. I think associated fns are better, with methods being the term for a fn that takes a |
@bors: rollup |
💔 Test failed - auto-mac-64-opt |
Sorry, this was failing a test due to one of the code blocks. I think I've fixed it. |
this needs 87c903a to fix it |
(i've added it to the rollup) |
Oops, I shouldn't have squashed. Sorry, and thanks. |
☔ The latest upstream changes (presumably #25384) made this pull request unmergeable. Please resolve the merge conflicts. |
Looks like this was merged in #25384 . Closing. |
This somehow got left out of rust-lang#25308
cc #16676