Skip to content

Commit a52be8a

Browse files
committed
mention marker traits
1 parent 22e66b4 commit a52be8a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

text/0000-dyn-upcasting.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ Given `trait A(n+1): Bn + Cn {}, trait Bn: An { fn bn(&self); }, trait Cn: An {
186186

187187
## Why not adopt a "pointer-based" vtable layout?
188188

189-
In this stable, every trait would have their own vtable, and we would embed links to each of them in the subtrait's vtable. This was rejected as it would be less efficient for the single-inheritance case, which is common.
189+
The current implementation uses a hybrid strategy that *sometimes* uses pointers. This was deemed preferable to using a *purely* pointer-based layout because it would be less efficient for the single-inheritance case, which is common.
190+
191+
## Are there other optimizations possible with vtable layout?
192+
193+
Certainly. Given that the RFC doesn't specify vtable layout, we still have room to do experimentation. For example, we might do special optimizations for traits with no methods.
190194

191195
# Prior art
192196
[prior-art]: #prior-art

0 commit comments

Comments
 (0)