diff options
| author | Steven Fackler <[email protected]> | 2016-11-04 18:40:43 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-11-04 18:40:43 -0700 |
| commit | 1108db74ec420f2042b44148ce86751e7b282b70 (patch) | |
| tree | bc9a3bc83a1efe4853628a1c56eca8af75e079c9 /openssl/src/util.rs | |
| parent | Make utility functions private (diff) | |
| parent | Get rid of Ref (diff) | |
| download | rust-openssl-1108db74ec420f2042b44148ce86751e7b282b70.tar.xz rust-openssl-1108db74ec420f2042b44148ce86751e7b282b70.zip | |
Merge pull request #512 from sfackler/no-ref
Get rid of Ref
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<()>); |