Skip to content

Commit 659d190

Browse files
committed
incorporate some review feedback
1 parent 925977f commit 659d190

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/ptr/metadata.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ impl<Dyn: ?Sized> DynMetadata<Dyn> {
204204
/// Returns the size of the type associated with this vtable.
205205
#[inline]
206206
pub fn size_of(self) -> usize {
207+
// Note that "size stored in vtable" is *not* the same as "result of size_of_val_raw".
208+
// Consider a reference like `&(i32, dyn Send)`: the vtable will only store the size of the
209+
// `Send` part!
207210
#[cfg(bootstrap)]
208211
return self.vtable_ptr.size_of;
209212
#[cfg(not(bootstrap))]

0 commit comments

Comments
 (0)