Update to nightly: explicit Copy trait

This commit is contained in:
Valerii Hiora 2014-12-11 13:44:37 +02:00
parent ae9e2b1e25
commit c922090075
7 changed files with 18 additions and 3 deletions

View File

@ -39,6 +39,7 @@ pub type X509_NAME_ENTRY = c_void;
pub type X509_REQ = c_void; pub type X509_REQ = c_void;
pub type X509_STORE_CTX = c_void; pub type X509_STORE_CTX = c_void;
#[allow(missing_copy_implementations)]
#[repr(C)] #[repr(C)]
pub struct EVP_MD_CTX { pub struct EVP_MD_CTX {
digest: *mut EVP_MD, digest: *mut EVP_MD,
@ -49,6 +50,7 @@ pub struct EVP_MD_CTX {
update: *mut c_void update: *mut c_void
} }
#[allow(missing_copy_implementations)]
#[repr(C)] #[repr(C)]
pub struct HMAC_CTX { pub struct HMAC_CTX {
md: *mut EVP_MD, md: *mut EVP_MD,
@ -59,6 +61,7 @@ pub struct HMAC_CTX {
key: [c_uchar, ..128] key: [c_uchar, ..128]
} }
#[allow(missing_copy_implementations)]
#[repr(C)] #[repr(C)]
pub struct X509V3_CTX { pub struct X509V3_CTX {
flags: c_int, flags: c_int,
@ -72,6 +75,7 @@ pub struct X509V3_CTX {
// Maybe more here // Maybe more here
} }
#[allow(missing_copy_implementations)]
#[repr(C)] #[repr(C)]
pub struct BIGNUM { pub struct BIGNUM {
pub d: *mut c_void, pub d: *mut c_void,

View File

@ -7,6 +7,7 @@ use ssl::error::SslError;
pub struct BigNum(*mut ffi::BIGNUM); pub struct BigNum(*mut ffi::BIGNUM);
#[deriving(Copy)]
#[repr(C)] #[repr(C)]
pub enum RNGProperty { pub enum RNGProperty {
MsbMaybeZero = -1, MsbMaybeZero = -1,

View File

@ -4,6 +4,7 @@ use std::io;
use ffi; use ffi;
#[deriving(Copy)]
pub enum HashType { pub enum HashType {
MD5, MD5,
SHA1, SHA1,

View File

@ -6,7 +6,7 @@ use crypto::hash::HashType;
use ffi; use ffi;
use ssl::error::{SslError, StreamError}; use ssl::error::{SslError, StreamError};
#[deriving(Copy)]
enum Parts { enum Parts {
Neither, Neither,
Public, Public,
@ -14,6 +14,7 @@ enum Parts {
} }
/// Represents a role an asymmetric key might be appropriate for. /// Represents a role an asymmetric key might be appropriate for.
#[deriving(Copy)]
pub enum Role { pub enum Role {
Encrypt, Encrypt,
Decrypt, Decrypt,
@ -22,6 +23,7 @@ pub enum Role {
} }
/// Type of encryption padding to use. /// Type of encryption padding to use.
#[deriving(Copy)]
pub enum EncryptionPadding { pub enum EncryptionPadding {
OAEP, OAEP,
PKCS1v15 PKCS1v15

View File

@ -2,12 +2,14 @@ use libc::{c_int};
use ffi; use ffi;
#[deriving(Copy)]
pub enum Mode { pub enum Mode {
Encrypt, Encrypt,
Decrypt, Decrypt,
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
#[deriving(Copy)]
pub enum Type { pub enum Type {
AES_128_ECB, AES_128_ECB,
AES_128_CBC, AES_128_CBC,

View File

@ -33,6 +33,7 @@ fn init() {
/// Determines the SSL method supported /// Determines the SSL method supported
#[deriving(Show, Hash, PartialEq, Eq)] #[deriving(Show, Hash, PartialEq, Eq)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
#[deriving(Copy)]
pub enum SslMethod { pub enum SslMethod {
#[cfg(feature = "sslv2")] #[cfg(feature = "sslv2")]
/// Only support the SSLv2 protocol, requires `feature="sslv2"` /// Only support the SSLv2 protocol, requires `feature="sslv2"`
@ -68,6 +69,7 @@ impl SslMethod {
} }
/// Determines the type of certificate verification used /// Determines the type of certificate verification used
#[deriving(Copy)]
#[repr(i32)] #[repr(i32)]
pub enum SslVerifyMode { pub enum SslVerifyMode {
/// Verify that the server's certificate is trusted /// Verify that the server's certificate is trusted

View File

@ -15,6 +15,7 @@ use ssl::error::{SslError, StreamError};
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;
#[deriving(Copy)]
#[repr(i32)] #[repr(i32)]
pub enum X509FileType { pub enum X509FileType {
PEM = ffi::X509_FILETYPE_PEM, PEM = ffi::X509_FILETYPE_PEM,
@ -22,6 +23,7 @@ pub enum X509FileType {
Default = ffi::X509_FILETYPE_DEFAULT Default = ffi::X509_FILETYPE_DEFAULT
} }
#[allow(missing_copy_implementations)]
pub struct X509StoreContext { pub struct X509StoreContext {
ctx: *mut ffi::X509_STORE_CTX ctx: *mut ffi::X509_STORE_CTX
} }
@ -54,7 +56,7 @@ trait AsStr<'a> {
fn as_str(&self) -> &'a str; fn as_str(&self) -> &'a str;
} }
#[deriving(Clone)] #[deriving(Clone, Copy)]
pub enum KeyUsage { pub enum KeyUsage {
DigitalSignature, DigitalSignature,
NonRepudiation, NonRepudiation,
@ -84,7 +86,7 @@ impl AsStr<'static> for KeyUsage {
} }
#[deriving(Clone)] #[deriving(Clone, Copy)]
pub enum ExtKeyUsage { pub enum ExtKeyUsage {
ServerAuth, ServerAuth,
ClientAuth, ClientAuth,
@ -430,6 +432,7 @@ pub struct X509Name<'x> {
macro_rules! make_validation_error( macro_rules! make_validation_error(
($ok_val:ident, $($name:ident = $val:ident,)+) => ( ($ok_val:ident, $($name:ident = $val:ident,)+) => (
#[deriving(Copy)]
pub enum X509ValidationError { pub enum X509ValidationError {
$($name,)+ $($name,)+
X509UnknownError(c_int) X509UnknownError(c_int)