Skip to content

Commit e928297

Browse files
committed
Rollup merge of rust-lang#31677 - ivan:doc-vtable, r=steveklabnik
I sure hope this fix is right cc @steveklabnik
2 parents 0ef8d42 + 58f0d72 commit e928297

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/doc/reference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,8 +3564,9 @@ Each instance of a trait object includes:
35643564
each method of `SomeTrait` that `T` implements, a pointer to `T`'s
35653565
implementation (i.e. a function pointer).
35663566

3567-
The purpose of trait objects is to permit "late binding" of methods. A call to
3568-
a method on a trait object is only resolved to a vtable entry at compile time.
3567+
The purpose of trait objects is to permit "late binding" of methods. Calling a
3568+
method on a trait object results in virtual dispatch at runtime: that is, a
3569+
function pointer is loaded from the trait object vtable and invoked indirectly.
35693570
The actual implementation for each vtable entry can vary on an object-by-object
35703571
basis.
35713572

0 commit comments

Comments
 (0)