diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs index 25cc852200a..2becaa83362 100644 --- a/library/core/src/ptr/metadata.rs +++ b/library/core/src/ptr/metadata.rs @@ -180,14 +180,15 @@ pub struct DynMetadata { phantom: crate::marker::PhantomData, } -/// Opaque type for accessing vtables. -/// -/// Private implementation detail of `DynMetadata::size_of` etc. -/// Must be zero-sized since there is conceptually not actually any Abstract Machine memory behind this pointer. -/// However, we can require pointer alignment. -#[repr(C)] #[cfg(not(bootstrap))] -struct VTable([usize; 0]); +extern "C" { + /// Opaque type for accessing vtables. + /// + /// Private implementation detail of `DynMetadata::size_of` etc. + /// Must be zero-sized since there is conceptually not actually any Abstract Machine memory behind this pointer. + /// However, we can require pointer alignment. + type VTable; +} /// The common prefix of all vtables. It is followed by function pointers for trait methods. ///