We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 925977f commit 659d190Copy full SHA for 659d190
core/src/ptr/metadata.rs
@@ -204,6 +204,9 @@ impl<Dyn: ?Sized> DynMetadata<Dyn> {
204
/// Returns the size of the type associated with this vtable.
205
#[inline]
206
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!
210
#[cfg(bootstrap)]
211
return self.vtable_ptr.size_of;
212
#[cfg(not(bootstrap))]
0 commit comments