summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEduardo Sánchez Muñoz <esm@eduardosm.net>2020-10-16 11:41:15 +0200
committerEduardo Sánchez Muñoz <esm@eduardosm.net>2020-10-16 11:41:15 +0200
commitd73e8a3d8623c0e63c9d3856533a18e81411d26f (patch)
tree0507dc4f4ac16760fe87e85aaafe233acba9615e /src
parent5b221b217971a831e7b46c0678f2993d6c04479b (diff)
downloadrust-libc-d73e8a3d8623c0e63c9d3856533a18e81411d26f.tar.gz
af_alg_iv: Move the deprecated attribute to the struct definition and specify version.
Diffstat (limited to 'src')
-rw-r--r--src/macros.rs2
-rw-r--r--src/unix/linux_like/android/mod.rs19
-rw-r--r--src/unix/linux_like/linux/mod.rs19
3 files changed, 22 insertions, 18 deletions
diff --git a/src/macros.rs b/src/macros.rs
index b314f60ff2..0ef64d572f 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -114,7 +114,9 @@ macro_rules! s_no_extra_traits {
$(#[$attr])*
pub struct $i { $($field)* }
}
+ #[allow(deprecated)]
impl ::Copy for $i {}
+ #[allow(deprecated)]
impl ::Clone for $i {
fn clone(&self) -> $i { *self }
}
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index c1a04fb7dc..38d3ba7da5 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -308,6 +308,11 @@ s_no_extra_traits! {
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
/// type are unsound and will be removed in the future.
+ #[deprecated(
+ note = "this struct has unsafe trait implementations that will be \
+ removed in the future",
+ since = "0.2.80"
+ )]
pub struct af_alg_iv {
pub ivlen: u32,
pub iv: [::c_uchar; 0],
@@ -593,6 +598,7 @@ cfg_if! {
}
}
+ #[allow(deprecated)]
impl af_alg_iv {
fn as_slice(&self) -> &[u8] {
unsafe {
@@ -604,20 +610,17 @@ cfg_if! {
}
}
- #[deprecated(
- note = "this trait implementation is unsound and will be removed"
- )]
+ #[allow(deprecated)]
impl PartialEq for af_alg_iv {
fn eq(&self, other: &af_alg_iv) -> bool {
*self.as_slice() == *other.as_slice()
}
}
- #[deprecated(
- note = "this trait implementation is unsound and will be removed"
- )]
+ #[allow(deprecated)]
impl Eq for af_alg_iv {}
+ #[allow(deprecated)]
impl ::fmt::Debug for af_alg_iv {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("af_alg_iv")
@@ -626,9 +629,7 @@ cfg_if! {
}
}
- #[deprecated(
- note = "this trait implementation is unsound and will be removed"
- )]
+ #[allow(deprecated)]
impl ::hash::Hash for af_alg_iv {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.as_slice().hash(state);
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index de4714ed63..adf922a411 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -540,6 +540,11 @@ s_no_extra_traits! {
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
/// type are unsound and will be removed in the future.
+ #[deprecated(
+ note = "this struct has unsafe trait implementations that will be \
+ removed in the future",
+ since = "0.2.80"
+ )]
pub struct af_alg_iv {
pub ivlen: u32,
pub iv: [::c_uchar; 0],
@@ -783,6 +788,7 @@ cfg_if! {
}
}
+ #[allow(deprecated)]
impl af_alg_iv {
fn as_slice(&self) -> &[u8] {
unsafe {
@@ -794,20 +800,17 @@ cfg_if! {
}
}
- #[deprecated(
- note = "this trait implementation is unsound and will be removed"
- )]
+ #[allow(deprecated)]
impl PartialEq for af_alg_iv {
fn eq(&self, other: &af_alg_iv) -> bool {
*self.as_slice() == *other.as_slice()
}
}
- #[deprecated(
- note = "this trait implementation is unsound and will be removed"
- )]
+ #[allow(deprecated)]
impl Eq for af_alg_iv {}
+ #[allow(deprecated)]
impl ::fmt::Debug for af_alg_iv {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("af_alg_iv")
@@ -816,9 +819,7 @@ cfg_if! {
}
}
- #[deprecated(
- note = "this trait implementation is unsound and will be removed"
- )]
+ #[allow(deprecated)]
impl ::hash::Hash for af_alg_iv {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.as_slice().hash(state);