- Allow static associated functions with the same name on different Self types (#1585)
- Deprecate extern shared struct syntax in favor of ExternType impl (#1586)
+ use cxx::ExternType; + + #[repr(C)] + pub struct Struct { + ... + } + + unsafe impl ExternType for Struct { + type Id = cxx::type_id!("path::to::Struct"); + type Kind = cxx::kind::Trivial; + } + #[cxx::bridge] pub mod ffi { - struct Struct { - ... - } - #[namespace = "path::to"] - unsafe extern "C++" { + extern "C++" { include!("..."); - type Struct; + type Struct = crate::Struct; } }