Skip to content

Commit b8543bd

Browse files
committed
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.
1 parent 2c4b35f commit b8543bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/extern_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub unsafe trait ExternType {
123123
/// [move constructor is trivial]: https://en.cppreference.com/w/cpp/types/is_move_constructible
124124
///
125125
/// If you believe your C++ type reflected by this ExternType impl is indeed
126-
/// trivial, you can specify:
126+
/// fine to hold by value and move in Rust, you can specify:
127127
///
128128
/// ```
129129
/// # struct TypeName;

0 commit comments

Comments
 (0)