diff options
Diffstat (limited to 'openssl/src/util.rs')
-rw-r--r-- | openssl/src/util.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openssl/src/util.rs b/openssl/src/util.rs index 49f38c3d..302bd316 100644 --- a/openssl/src/util.rs +++ b/openssl/src/util.rs @@ -1,6 +1,6 @@ use libc::{c_int, c_char, c_void}; - use std::any::Any; +use std::cell::UnsafeCell; use std::panic::{self, AssertUnwindSafe}; use std::slice; @@ -60,3 +60,8 @@ pub unsafe extern "C" fn invoke_passwd_cb<F>(buf: *mut c_char, } } } + +/// This is intended to be used as the inner type for `FooRef` types converted from raw C pointers. +/// It has an `UnsafeCell` internally to inform the compiler about aliasability and doesn't +/// implement `Copy`, so it can't be dereferenced. +pub struct Opaque(UnsafeCell<()>); |