From 01ae978db0dc8620b2cc754c0d5cf94a68c1f549 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 4 Nov 2016 16:32:20 -0700 Subject: Get rid of Ref There's unfortunately a rustdoc bug that causes all methods implemented for any Ref to be inlined in the deref methods section :( --- openssl/src/util.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'openssl/src/util.rs') 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(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<()>); -- cgit v1.2.3