Skip to content

Commit 58f0d72

Browse files
committed
reference: vtable entries: copy @nikomatsakis's wording
1 parent 347a257 commit 58f0d72

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 runtime.
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)