Releases: dtolnay/cxx
Releases · dtolnay/cxx
1.0.3
1.0.2
1.0.1
- Fix ability to use an extern enum (https://cxx.rs/shared.html#extern-enums) as a field of a shared struct (#490)
- Allow shared enums to contain multiple discriminants with the same integer value, relaxing a restriction that C++ does not have (#492)
- Add impl DerefMut for UniquePtr<T> as long as T is a shared struct, not an opaque C++ type (#493)
1.0.0
Breaking changes
extern "C"
extern block in the FFI module is no longer accepted, writeextern "C++"
insteadextern "C++"
block must be writtenunsafe extern "C++"
if it contains at least one safe-to-call functionrust::Slice<T>
in C++ has been renamed torust::Slice<const T>
; support for &mut [T] post-1.0 will use therust::Slice<T>
name&mut T
where T is an opaque C++ type is no longer ever exposed to Rust, onlyPin<&mut T>
- Related to the previous:
UniquePtr
binding no longer implements DerefMut for opaque C++ types - If a function's implementation is unsafe in Rust,
extern "Rust"
block will enforce that it's listed asunsafe fn
in the extern block too - Opaque Rust types are required to be
Unpin
in addition toSized
- Opaque Rust types are required to be local to the current crate (for now; this may soon be lifted again)
- Handwritten
Unpin
impl for opaque C++ types are ruled out - Minimum supported rustc version is raised from 1.43 to 1.48
0.5.10
0.5.9
0.5.8
-
Support
#[namespace = "..."]
attribute on extern blocks (#444)An item will inherit the namespace specified on its surrounding extern block if any, otherwise the namespace specified with the top level cxx::bridge attribute.
#[cxx::bridge(namespace = "third_priority")] mod ffi { #[namespace = "second_priority"] extern "Rust" { fn f(); #[namespace = "first_priority"] fn g(); } extern "Rust" { fn h(); } }
The above would result in functions
::second_priority::f
,::first_priority::g
,::third_priority::h
.
0.5.7
0.5.6
0.5.5
- Introduce a mechanism to publicly export headers from a dependency in Cargo-based builds (#417)
See the documentation of: