use extern type for extra opaqueness
This commit is contained in:
parent
5e840c5c8c
commit
114da84996
@ -180,14 +180,15 @@ pub struct DynMetadata<Dyn: ?Sized> {
|
||||
phantom: crate::marker::PhantomData<Dyn>,
|
||||
}
|
||||
|
||||
/// 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.
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user