mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-27 09:20:33 +00:00
Tweak wording of the triviality requirement
It isn't actually a requirement that the type have no destructor as brought up by the previous paragraph. Rather, it just needs to be safe for values of that type to be moved via Rust's memcpy-based move semantics. The distinction is relevant e.g. for `struct S { s: String }` which would have a C++ destructor and nontrivial move constructor but still be safely memcpy movable.
This commit is contained in:
parent
2c4b35f486
commit
b8543bd30c
@ -123,7 +123,7 @@ pub unsafe trait ExternType {
|
||||
/// [move constructor is trivial]: https://en.cppreference.com/w/cpp/types/is_move_constructible
|
||||
///
|
||||
/// If you believe your C++ type reflected by this ExternType impl is indeed
|
||||
/// trivial, you can specify:
|
||||
/// fine to hold by value and move in Rust, you can specify:
|
||||
///
|
||||
/// ```
|
||||
/// # struct TypeName;
|
||||
|
Loading…
Reference in New Issue
Block a user