diff --git a/macro/src/expand.rs b/macro/src/expand.rs index f88b602fe..6d414c3a4 100644 --- a/macro/src/expand.rs +++ b/macro/src/expand.rs @@ -170,6 +170,7 @@ fn expand_struct(strct: &Struct) -> TokenStream { #struct_def unsafe impl #generics ::cxx::ExternType for #ident #generics { + #[doc(hidden)] type Id = #type_id; type Kind = ::cxx::kind::Trivial; } @@ -330,6 +331,7 @@ fn expand_enum(enm: &Enum) -> TokenStream { } unsafe impl ::cxx::ExternType for #ident { + #[doc(hidden)] type Id = #type_id; type Kind = ::cxx::kind::Trivial; } @@ -370,6 +372,7 @@ fn expand_cxx_type(ety: &ExternType) -> TokenStream { #extern_type_def unsafe impl #generics ::cxx::ExternType for #ident #generics { + #[doc(hidden)] type Id = #type_id; type Kind = ::cxx::kind::Opaque; } @@ -739,6 +742,7 @@ fn expand_rust_type_impl(ety: &ExternType) -> TokenStream { let span = derive.span; impls.extend(quote_spanned! {span=> unsafe impl #generics ::cxx::ExternType for #ident #generics { + #[doc(hidden)] type Id = #type_id; type Kind = ::cxx::kind::Opaque; } diff --git a/src/extern_type.rs b/src/extern_type.rs index 99e0cb1ca..35057acb8 100644 --- a/src/extern_type.rs +++ b/src/extern_type.rs @@ -188,6 +188,7 @@ macro_rules! impl_extern_type { ($([$kind:ident] $($ty:path = $cxxpath:literal)*)*) => { $($( unsafe impl ExternType for $ty { + #[doc(hidden)] type Id = crate::type_id!($cxxpath); type Kind = $kind; }