use extern type for extra opaqueness
This commit is contained in:
parent
5e840c5c8c
commit
114da84996
1 changed files with 8 additions and 7 deletions
|
@ -180,14 +180,15 @@ pub struct DynMetadata<Dyn: ?Sized> {
|
||||||
phantom: crate::marker::PhantomData<Dyn>,
|
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))]
|
#[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.
|
/// The common prefix of all vtables. It is followed by function pointers for trait methods.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue