NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io, #1067 most downloaded on crates.io
Implementation detail of the `cxx` crate.
Latest stable
1.0.205
Last release 1 months ago
11 Oct 2026
Ships unpredictably
gaps range from 8 days to 5 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
251 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
Opt out of -Zrustdoc-scrape-examples on docs.rs for now
-Zrustdoc-scrape-examples on docs.rs for nowNothing published for this version
Fix compile error in generated code when dealing with references that refer to pointers
Add an opt-in to propagate Rust docs from the cxx::bridge module as Doxygen-style comments in the generated C++ header
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Support raw identifiers in namespace attribute: #[namespace = org::r#box::implementation]
#[namespace = org::r#box::implementation] (#1126)Fix _"cannot find type Box in this scope"_ build error when using Box, String, Vec in default-features = false, features = ["alloc"] mode
default-features = false, features = ["alloc"] mode (#1065)Allow `trycatch` to be written using a std::string argument to fail, instead of just const char *
trycatch to be written using a std::string argument to fail, instead of just const char * (#1114)Update argument parser to clap 4
- Support Vec /rust::Vec
Vec<bool>/rust::Vec<bool> (#1103)Allow Rust vector of array of trivially relocatable type
Add Unpin impl for cxx::UniquePtr (#1091, thanks @LeonMatthesKDAB)
Unpin impl for cxx::UniquePtr (#1091, thanks @LeonMatthesKDAB)Fix _"filename, directory name, or volume label syntax is incorrect"_ build error on Windows when the target dir in which cxx-build is running contain
target dir in which cxx-build is running contains broken symlinks (#1085)Add categories to crates.io metadata
Work around unused_must_used warning being emitted inside generated code by recent nightly compilers
unused_must_used warning being emitted inside generated code by recent nightly compilersFix legacy_derive_helpers lint when using serde attributes on a shared struct (#1064, thanks @luckyuro)
Make clippy attrs on extern blocks apply to all contents of the block
extern blocks apply to all contents of the block (#1061)extern "Rust" functions (#1062)Update command line argument parser to clap 3.2
clap 3.2 (#1060)Eliminate unused_attributes warning in generated code
unused_attributes warning in generated codeImprovements to the Bazel build rules:
Support C arrays as struct fields inside types with a handwritten ExternType impl
ExternType impl (#1021)Update command line argument parser to clap 3.1
Support #[cfg(debug_assertions)] inside ffi module in Cargo-based builds
#[cfg(debug_assertions)] inside ffi module in Cargo-based buildsasync fn inside ffi moduleAdd support for conditional compilation using #[cfg(...)] attributes inside the bridge module
#[cfg(...)] attributes inside the bridge module (#989) #[cfg(target_os = "android")]
type CallInvokerHolder;
#[cfg(target_os = "android")]
fn getCallInvoker(self: Pin<&mut CallInvokerHolder>) -> SharedPtr<CallInvoker>;
Update command line parser to clap 3
Add String::lossy constructors to C++ API, corresponding to from_utf8_lossy and from_utf16_lossy (#984, thanks @benesch)
String::lossy constructors to C++ API, corresponding to from_utf8_lossy and from_utf16_lossy (#984, thanks @benesch)Vec<T>::truncate to C++ API (#988, thanks @benesch)const char16_t* passed to a rust::String constructor (#992)Optimize the Debug and Display impl of CxxString to eliminate memory allocation
CxxString to eliminate memory allocation (#979)Drop, PartialEq, PartialOrd, or Hash trait impls from causing UB when called from C++ (#980)elided_lifetimes_in_paths lint (#907, #981)Add clear() member function to rust::Vec in C++ (#951, thanks @rookboom)
clear() member function to rust::Vec<T> in C++ (#951, thanks @rookboom)no_std mode (#969, #970, #971, #972, #973, #974, #975)
no_std mode (#969, #970, #971, #972, #973, #974, #975)
[dependencies]
cxx = { version = "1.0", default-features = false, features = ["alloc"] }
A no_alloc mode is also implemented but is not stable yet in this release.
[dependencies]
cxx = { version = "1.0", default-features = false }
Apply --cxx-impl-annotations also to the functions underlying UniquePtr and similar builtin bindings (#967, thanks @adetaylor)
--cxx-impl-annotations also to the functions underlying UniquePtr and similar builtin bindings (#967, thanks @adetaylor)Pass through doc(hidden) attributes inside the bridge module
doc(hidden) attributes inside the bridge module (#945)Fix build script race causing *"Failed to create symlink ... File exists (os error 17)"* in cxx_build
cxx_build (#938)Enable C++ to reserve and read capacity on a rust::String
Enable C++ to reserve and read capacity on a rust::String (#924)
Enable Rust to reserve capacity on a CxxString (#925)
This is important in APIs that connect bytes-based code in Rust to std::string-based code in C++.
use bytes::Buf;
use cxx::let_cxx_string;
fn thing(buf: &mut dyn Buf) {
let_cxx_string!(string = "");
// handled by helper:
string.as_mut().reserve(buf.remaining());
while buf.remaining() > 0 {
let chunk = buf.chunk();
string.as_mut().push_bytes(chunk);
buf.advance(chunk.len());
}
ffi::thing(string);
}
// ffi::thing:
// void thing(std::string& s) {
// WriteMessage msg{std::move(s)};
// ...
// }
Prevent lint inside generated C++ code in projects that build with -Wshadow (#919, thanks @isg)
-Wshadow (#919, thanks @isg)Add method to clear a C++ std::string from Rust
clear a C++ std::string from Rust (#912)Expose UTF-16 rust::String construction to C++ (#906, thanks @Gerharddc)
Allow extern type aliases that have an impl of ExternType to be used as slice elements
ExternType<Kind = Trivial> to be used as slice elements (#904)Fix failure to compile generated Rust code in the case of CxxVector containing shared struct containing Rust string
Add bool empty() const member function in C++ on rust::Str, rust::String
bool empty() const member function in C++ on rust::Str, rust::String (#853)Some experimental changes related to ingesting Clang ASTs to glean information about enum variant names and discriminant values for which C++ is the s
Fix some Clippy lint warnings appearing in generated code (#843, #844)
Add `push` and `pop` functionality to CxxVector in Rust
Fix placement of C++ documentation comments on member functions of shared types and extern Rust types
#![deny(missing_docs)], inside FFI module (#833)Fix noncompilable call operator for rust::Fn with a non-const reference argument
Improve error message placement from cxx-build or cxxbridge CLI for files that fail to lex (#801, https://github.com/alexcrichton/proc-macro2/pull/283
Detect unsound signatures involving mutable slices in C++ function return position
Permit C++ to safely construct an empty Rust slice using a null data pointer
stdexcept #include for code containing Rust slices or vectors (#791)Improve diagnostic placement for compile errors inside of implicitly generated shim trait impls
Support reference return type on a fallible extern "Rust" function
extern "Rust" function (#782)Relax some restrictions on references in return position of functions with explicit lifetime annotations (#763, #764, #765)
Cut out some noise from generated code if bridge already has "rust/cxx.h" included
Support non-static vector element types inside of unique ptr: UniquePtr >>
UniquePtr<CxxVector<Thing<'a>>> (#760)CxxVector, UniquePtr, and SharedPtr inside of generic code (#762)Support raw pointers in FFI signatures – https://cxx.rs/binding/rawptr.html (#689, thanks @adetaylor)
Provide trait impls of Eq, Ord, PartialOrd, Hash for CxxString, allowing it to be used as a HashMap or BTreeMap key (#743, thanks @b05902132)
Disallow placing an ineffective Drop impl on shared structs (#708, #711)
Drop impl on shared structs (#708, #711)type_id! macro inside of crates that have the cxx crate imported under a different name (#712)String, Str, Slice, Box, Vec as lhs of an assignment operator (#698)Clarify error for using enum as method receiver (#688, thanks @fletcherw)
rust::Vec<size_t> on macOS (#707, #705)Fix let_cxx_string! to allow use of lhs variable name in rhs initialization expression
let_cxx_string! to allow use of lhs variable name in rhs initialization expression (#701)cc's parallel build feature for cxx-build (#704, thanks @edsrzf)Allow let_cxx_string! to work inside of async functions
let_cxx_string! to work inside of async functions (#693)Fix a missing #include manifested on MSVC when using Rust slices or vectors
Implement lifetime elision for member function receivers (#660, #661)
Implement lifetime elision for member function receivers (#660, #661)
#[cxx::bridge]
mod ffi {
unsafe extern "C++" {
type Object<'a>;
fn f(self: &Object); // elided lifetimes equivalent to `fn f<'a, 'b>(self: &'a Object<'b>)`
fn g(self: Pin<&mut Object>); // elided lifetimes equivalent to `fn g<'a, 'b>(self: Pin<&'a mut Object<'b>>)`
}
}
Support Vec<&str> type (#662)
Improve error messages when failing to parse an extern fn (#659)
Support lifetimes on extern types (#610, #611, #622, #624, #627, #628, #630, #634, #635, #652, #653)
Support lifetimes on extern types (#610, #611, #622, #624, #627, #628, #630, #634, #635, #652, #653)
#[cxx::bridge]
mod ffi {
unsafe extern "C++" {
type Resource;
type Holder<'a>; // contains a `const Resource &`
fn makeHolder<'a>(resource: &'a Resource) -> SharedPtr<Holder<'a>>;
// or with lifetime elision
fn makeHolder(resource: &Resource) -> SharedPtr<Holder>;
}
}
Support lifetimes on shared structs (#650)
#[cxx::bridge]
mod ffi {
struct Example<'a> {
s: &'a str,
x: &'a [UniquePtr<Thing<'a>>],
}
}
Support &str and &[T] as element type of slices and arrays (#636, #638, #644, #645, #647, #651)
mod ffi {
extern "Rust" {
fn demo(flags: &[&str]);
}
}
Support #[rust_name = "..."] and #[cxx_name = "..."] attributes on fields of shared structs (#631, #632)
#[cxx::bridge]
mod ffi {
struct Example {
#[cxx_name = "type"] // `type` is a keyword in Rust, but not C++
ty: Type,
}
}
Provide swap() const member functions for the types in cxx.h (#642, #643, #646, thanks @capickett)
Clean up warnings in generated code on various platforms (#637, #639, #640, #648, #649)
One column per quarter.