MSVC warns about the ones that are specialized out of line.
cxxbridge\include\rust/cxx.h(324): warning C4661: 'rust::cxxbridge1::Vec<uint8_t>::Vec(void) noexcept': no suitable definition provided for explicit template instantiation request
cxxbridge\include\rust/cxx.h(269): note: see declaration of 'rust::cxxbridge1::Vec<uint8_t>::Vec'
cxxbridge\include\rust/cxx.h(324): warning C4661: 'size_t rust::cxxbridge1::Vec<uint8_t>::size(void) noexcept const': no suitable definition provided for explicit template instantiation request
cxxbridge\include\rust/cxx.h(278): note: see declaration of 'rust::cxxbridge1::Vec<uint8_t>::size'
cxxbridge\include\rust/cxx.h(324): warning C4661: 'const T *rust::cxxbridge1::Vec<T>::data(void) noexcept const': no suitable definition provided for explicit template instantiation request
with
[
T=uint8_t
]
cxxbridge\include\rust/cxx.h(280): note: see declaration of 'rust::cxxbridge1::Vec<uint8_t>::data'
cxxbridge\include\rust/cxx.h(324): warning C4661: 'size_t rust::cxxbridge1::Vec<uint8_t>::capacity(void) noexcept const': no suitable definition provided for explicit template instantiation request
cxxbridge\include\rust/cxx.h(282): note: see declaration of 'rust::cxxbridge1::Vec<uint8_t>::capacity'
I guess MSVC finds this important enough to emit warnings about.
cxxbridge\sources\tests\ffi\lib.rs.cc(1220): warning C4624: 'tests::R': destructor was implicitly defined as deleted
cxxbridge\sources\tests\ffi\lib.rs.cc(1335): warning C4190: 'tests$cxxbridge1$c_return_str' has C-linkage specified, but returns UDT 'rust::cxxbridge1::Str' which is incompatible with C
cxxbridge\include\rust/cxx.h(93): note: see declaration of 'rust::cxxbridge1::Str'
cxxbridge\sources\tests\ffi\lib.rs.cc(1340): warning C4190: 'tests$cxxbridge1$c_return_slice_char' has C-linkage specified, but returns UDT 'rust::cxxbridge1::Slice<const char>' which is incompatible with C
cxxbridge\crate\tests/ffi/tests.h(93): note: see declaration of 'rust::cxxbridge1::Slice<const char>'
cxxbridge\sources\tests\ffi\lib.rs.cc(1345): warning C4190: 'tests$cxxbridge1$c_return_mutsliceu8' has C-linkage specified, but returns UDT 'rust::cxxbridge1::Slice<uint8_t>' which is incompatible with C
cxxbridge\crate\tests/ffi/tests.h(94): note: see declaration of 'rust::cxxbridge1::Slice<uint8_t>'
cxxbridge\sources\tests\ffi\lib.rs.cc(1976): warning C4190: 'tests$cxxbridge1$r_return_str' has C-linkage specified, but returns UDT 'rust::cxxbridge1::Str' which is incompatible with C
cxxbridge\include\rust/cxx.h(93): note: see declaration of 'rust::cxxbridge1::Str'
cxxbridge\sources\tests\ffi\lib.rs.cc(1978): warning C4190: 'tests$cxxbridge1$r_return_sliceu8' has C-linkage specified, but returns UDT 'rust::cxxbridge1::Slice<const uint8_t>' which is incompatible with C
cxxbridge\crate\tests/ffi/tests.h(163): note: see declaration of 'rust::cxxbridge1::Slice<const uint8_t>'
cxxbridge\sources\tests\ffi\lib.rs.cc(1980): warning C4190: 'tests$cxxbridge1$r_return_mutsliceu8' has C-linkage specified, but returns UDT 'rust::cxxbridge1::Slice<uint8_t>' which is incompatible with C
cxxbridge\crate\tests/ffi/tests.h(94): note: see declaration of 'rust::cxxbridge1::Slice<uint8_t>'
src/cxx.cc(356): error C2220: the following warning is treated as an error
src/cxx.cc(356): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
In file included from src/cxx.cc:1:
src/../include/cxx.h:131:33: error: private field 'repr' is not used [-Werror,-Wunused-private-field]
std::array<std::uintptr_t, 2> repr;
^
The swap member functions are going to be infrequently used (relative to
things like operator==, Box's operator->) so let's present it lower down
in the API.