Skip to content

Commit d73e8a3

Browse files
committed
af_alg_iv: Move the deprecated attribute to the struct definition and specify version.
1 parent 5b221b2 commit d73e8a3

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

src/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ macro_rules! s_no_extra_traits {
114114
$(#[$attr])*
115115
pub struct $i { $($field)* }
116116
}
117+
#[allow(deprecated)]
117118
impl ::Copy for $i {}
119+
#[allow(deprecated)]
118120
impl ::Clone for $i {
119121
fn clone(&self) -> $i { *self }
120122
}

src/unix/linux_like/android/mod.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ s_no_extra_traits! {
308308

309309
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
310310
/// type are unsound and will be removed in the future.
311+
#[deprecated(
312+
note = "this struct has unsafe trait implementations that will be \
313+
removed in the future",
314+
since = "0.2.80"
315+
)]
311316
pub struct af_alg_iv {
312317
pub ivlen: u32,
313318
pub iv: [::c_uchar; 0],
@@ -593,6 +598,7 @@ cfg_if! {
593598
}
594599
}
595600

601+
#[allow(deprecated)]
596602
impl af_alg_iv {
597603
fn as_slice(&self) -> &[u8] {
598604
unsafe {
@@ -604,20 +610,17 @@ cfg_if! {
604610
}
605611
}
606612

607-
#[deprecated(
608-
note = "this trait implementation is unsound and will be removed"
609-
)]
613+
#[allow(deprecated)]
610614
impl PartialEq for af_alg_iv {
611615
fn eq(&self, other: &af_alg_iv) -> bool {
612616
*self.as_slice() == *other.as_slice()
613617
}
614618
}
615619

616-
#[deprecated(
617-
note = "this trait implementation is unsound and will be removed"
618-
)]
620+
#[allow(deprecated)]
619621
impl Eq for af_alg_iv {}
620622

623+
#[allow(deprecated)]
621624
impl ::fmt::Debug for af_alg_iv {
622625
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
623626
f.debug_struct("af_alg_iv")
@@ -626,9 +629,7 @@ cfg_if! {
626629
}
627630
}
628631

629-
#[deprecated(
630-
note = "this trait implementation is unsound and will be removed"
631-
)]
632+
#[allow(deprecated)]
632633
impl ::hash::Hash for af_alg_iv {
633634
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
634635
self.as_slice().hash(state);

src/unix/linux_like/linux/mod.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,11 @@ s_no_extra_traits! {
540540

541541
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
542542
/// type are unsound and will be removed in the future.
543+
#[deprecated(
544+
note = "this struct has unsafe trait implementations that will be \
545+
removed in the future",
546+
since = "0.2.80"
547+
)]
543548
pub struct af_alg_iv {
544549
pub ivlen: u32,
545550
pub iv: [::c_uchar; 0],
@@ -783,6 +788,7 @@ cfg_if! {
783788
}
784789
}
785790

791+
#[allow(deprecated)]
786792
impl af_alg_iv {
787793
fn as_slice(&self) -> &[u8] {
788794
unsafe {
@@ -794,20 +800,17 @@ cfg_if! {
794800
}
795801
}
796802

797-
#[deprecated(
798-
note = "this trait implementation is unsound and will be removed"
799-
)]
803+
#[allow(deprecated)]
800804
impl PartialEq for af_alg_iv {
801805
fn eq(&self, other: &af_alg_iv) -> bool {
802806
*self.as_slice() == *other.as_slice()
803807
}
804808
}
805809

806-
#[deprecated(
807-
note = "this trait implementation is unsound and will be removed"
808-
)]
810+
#[allow(deprecated)]
809811
impl Eq for af_alg_iv {}
810812

813+
#[allow(deprecated)]
811814
impl ::fmt::Debug for af_alg_iv {
812815
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
813816
f.debug_struct("af_alg_iv")
@@ -816,9 +819,7 @@ cfg_if! {
816819
}
817820
}
818821

819-
#[deprecated(
820-
note = "this trait implementation is unsound and will be removed"
821-
)]
822+
#[allow(deprecated)]
822823
impl ::hash::Hash for af_alg_iv {
823824
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
824825
self.as_slice().hash(state);

0 commit comments

Comments
 (0)