summaryrefslogtreecommitdiff
path: root/openssl/src/util.rs
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2016-11-04 16:32:20 -0700
committerSteven Fackler <sfackler@gmail.com>2016-11-04 17:16:59 -0700
commit01ae978db0dc8620b2cc754c0d5cf94a68c1f549 (patch)
treebc9a3bc83a1efe4853628a1c56eca8af75e079c9 /openssl/src/util.rs
parent25443d7b486576b846ed90125e3e56e16c9bc734 (diff)
downloadrust-openssl-01ae978db0dc8620b2cc754c0d5cf94a68c1f549.zip
Get rid of Ref
There's unfortunately a rustdoc bug that causes all methods implemented for any Ref<T> to be inlined in the deref methods section :(
Diffstat (limited to 'openssl/src/util.rs')
-rw-r--r--openssl/src/util.rs7
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<()>);