Releases: dtolnay/cxx
Releases · dtolnay/cxx
1.0.61
Add String::lossy
constructors to C++ API, corresponding to from_utf8_lossy and from_utf16_lossy (#984 , thanks @benesch )
Add Vec<T>::truncate
to C++ API (#988 , thanks @benesch )
Assert sufficient alignment of const char16_t*
passed to a rust::String
constructor (#992 )
1.0.60
Optimize the Debug and Display impl of CxxString
to eliminate memory allocation (#979 )
Prevent handwritten panicking Drop
, PartialEq
, PartialOrd
, or Hash
trait impls from causing UB when called from C++ (#980 )
Add support for codebases that choose to opt in to elided_lifetimes_in_paths
lint (#907 , #981 )
1.0.59
Add clear()
member function to rust::Vec<T>
in C++ (#951 , thanks @rookboom )
1.0.58
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 }
1.0.57
Apply --cxx-impl-annotations
also to the functions underlying UniquePtr and similar builtin bindings (#967 , thanks @adetaylor )
1.0.56
Pass through doc(hidden)
attributes inside the bridge module (#945 )
1.0.55
Fix build script race causing "Failed to create symlink ... File exists (os error 17)" in cxx_build
(#938 )
1.0.54
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)};
// ...
// }
1.0.53
Prevent lint inside generated C++ code in projects that build with -Wshadow
(#919 , thanks @isg )
1.0.52
Add method to clear
a C++ std::string from Rust (#912 )
You can’t perform that action at this time.