Loading openssl/src/lib.rs +0 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ macro_rules! type_ { } mod bio; mod opaque; mod util; pub mod asn1; pub mod bn; Loading openssl/src/opaque.rsdeleted 100644 → 0 +0 −6 Original line number Diff line number Diff line use std::cell::UnsafeCell; /// This is intended to be used as the inner type for types designed to be pointed to by references /// 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<()>); openssl/src/types.rs +2 −3 Original line number Diff line number Diff line use std::cell::UnsafeCell; use std::marker::PhantomData; use opaque::Opaque; pub unsafe trait OpenSslType { type CType; Loading @@ -10,7 +9,7 @@ pub unsafe trait OpenSslType { fn as_ptr(&self) -> *mut Self::CType; } pub struct Ref<T>(Opaque, PhantomData<T>); pub struct Ref<T>(UnsafeCell<()>, PhantomData<T>); impl<T: OpenSslType> Ref<T> { pub unsafe fn from_ptr<'a>(ptr: *mut T::CType) -> &'a Ref<T> { Loading Loading
openssl/src/lib.rs +0 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ macro_rules! type_ { } mod bio; mod opaque; mod util; pub mod asn1; pub mod bn; Loading
openssl/src/opaque.rsdeleted 100644 → 0 +0 −6 Original line number Diff line number Diff line use std::cell::UnsafeCell; /// This is intended to be used as the inner type for types designed to be pointed to by references /// 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<()>);
openssl/src/types.rs +2 −3 Original line number Diff line number Diff line use std::cell::UnsafeCell; use std::marker::PhantomData; use opaque::Opaque; pub unsafe trait OpenSslType { type CType; Loading @@ -10,7 +9,7 @@ pub unsafe trait OpenSslType { fn as_ptr(&self) -> *mut Self::CType; } pub struct Ref<T>(Opaque, PhantomData<T>); pub struct Ref<T>(UnsafeCell<()>, PhantomData<T>); impl<T: OpenSslType> Ref<T> { pub unsafe fn from_ptr<'a>(ptr: *mut T::CType) -> &'a Ref<T> { Loading