| commit | 95dab1db60d5ace5803f2132255d575d233ae8a8 | [log] [tgz] |
|---|---|---|
| author | David Tolnay <dtolnay@gmail.com> | Sun Nov 15 14:32:37 2020 -0800 |
| committer | David Tolnay <dtolnay@gmail.com> | Sun Nov 15 14:50:58 2020 -0800 |
| tree | 8975fdf6d6771f1b457b1c379c8d88a978706926 | |
| parent | cf9aed6fd90c5197a61f4e3c135302a963b7252e [diff] [blame] |
Ensure opaque types are !Unpin
diff --git a/src/cxx_string.rs b/src/cxx_string.rs index 5010175..7ee8987 100644 --- a/src/cxx_string.rs +++ b/src/cxx_string.rs
@@ -1,6 +1,7 @@ use alloc::borrow::Cow; use alloc::string::String; use core::fmt::{self, Debug, Display}; +use core::marker::{PhantomData, PhantomPinned}; use core::slice; use core::str::{self, Utf8Error}; @@ -26,6 +27,7 @@ #[repr(C)] pub struct CxxString { _private: [u8; 0], + _pinned: PhantomData<PhantomPinned>, } impl CxxString {