Required by the transitive dev-dependency on once_cell.
error: failed to parse manifest at github.com-1ecc6299db9ec823/once_cell-1.15.0/Cargo.toml
Caused by:
feature `edition2021` is required
The package requires the Cargo feature called `edition2021`, but that feature is not stabilized in this version of Cargo (1.55.0 (32da73ab1 2021-08-23)).
Consider trying a newer version of Cargo (this may require the nightly release).
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2021 for more information about the status of this feature.
The previous code works in _some_ STL implementations, namely if
_either_ of the following is true:
1. At least one of the other four STL headers included by json.h
transitively includes <string>, as opposed to just <stringfwd.h>; or
2. The way std::variant is implemented does not require knowing the
inner types' type traits when just naming the std::variant
without yet instantiating any of its member function templates.
On other STL implementations in which neither of the above is true, this
example failed to build with an error such as:
In file included from target/debug/build/example-d2d484e0c793273c/out/cxxbridge/sources/example/src/main.rs.cc:1:
In file included from target/debug/build/example-d2d484e0c793273c/out/cxxbridge/crate/example/include/json.h:2:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/map:60:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_tree.h:63:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algobase.h:64:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_pair.h:59:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/move.h:57:
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:1339:23: error: implicit instantiation of undefined template 'std::basic_string<char>'
__bool_constant<__has_trivial_destructor(_Tp)>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:3214:5: note: in instantiation of template class 'std::is_trivially_destructible<std::basic_string<char>>' requested here
is_trivially_destructible<_Tp>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/variant:299:5: note: in instantiation of variable template specialization 'std::is_trivially_destructible_v<std::basic_string<char>>' requested here
(is_trivially_destructible_v<_Types> && ...);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/variant:308:4: note: in instantiation of static data member 'std::__detail::__variant::_Traits<std::monostate, double, std::basic_string<char>, std::vector<json>, std::map<std::basic_string<char>, json>>::_S_trivial_dtor' requested here
_S_trivial_dtor && _S_trivial_move_ctor
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/variant:689:45: note: in instantiation of static data member 'std::__detail::__variant::_Traits<std::monostate, double, std::basic_string<char>, std::vector<json>, std::map<std::basic_string<char>, json>>::_S_trivial_move_assign' requested here
_Move_assign_base<_Traits<_Types...>::_S_trivial_move_assign, _Types...>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/variant:692:28: note: in instantiation of template type alias '_Move_assign_alias' requested here
struct _Variant_base : _Move_assign_alias<_Types...>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/variant:1318:15: note: in instantiation of template class 'std::__detail::__variant::_Variant_base<std::monostate, double, std::basic_string<char>, std::vector<json>, std::map<std::basic_string<char>, json>>' requested here
: private __detail::__variant::_Variant_base<_Types...>,
^
target/debug/build/example-d2d484e0c793273c/out/cxxbridge/crate/example/include/json.h:33:63: note: in instantiation of template class 'std::variant<std::monostate, double, std::basic_string<char>, std::vector<json>, std::map<std::basic_string<char>, json>>' requested here
std::variant<std::monostate, number, string, array, object> value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stringfwd.h:74:11: note: template is declared here
class basic_string;
^
These traits are closely related. The meaning of Pin<P> when P isn't
Unpin is that in between when P ends up in the pin and when P's Drop
impl begins running, it must not be moved. Moving before the pin, or
moving from within drop once the Drop impl is in progress, are fine.
Required by the transitive dependency on os_str_bytes:
error: package `os_str_bytes v6.2.0` cannot be built because it
requires rustc 1.57.0 or newer, while the currently active rustc
version is 1.56.1
warning: unused return value of `Box::<T>::from_raw` that must be used
--> tests/ffi/lib.rs:337:22
|
337 | impl Box<Shared> {}
| ^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
warning: unused return value of `Box::<T>::from_raw` that must be used
--> tests/ffi/lib.rs:72:27
|
72 | second: Box<Second>,
| ^
|
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
warning: unused return value of `Box::<T>::from_raw` that must be used
--> tests/ffi/lib.rs:99:35
|
99 | fn c_return_box() -> Box<R>;
| ^
|
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`