Skip to content

Commit 8a846aa

Browse files
authored
Merge pull request #3565 from JohnTitor/rm-unsafe-impls
Remove some unsafe impls
2 parents fd01d57 + 0c9b044 commit 8a846aa

File tree

2 files changed

+2
-90
lines changed

2 files changed

+2
-90
lines changed

src/unix/linux_like/android/mod.rs

+1-45
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,7 @@ s_no_extra_traits! {
590590
pub absflat: [::__s32; ABS_CNT],
591591
}
592592

593-
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
594-
/// type are unsound and will be removed in the future.
595-
#[deprecated(
596-
note = "this struct has unsafe trait implementations that will be \
597-
removed in the future",
598-
since = "0.2.80"
599-
)]
593+
#[allow(missing_debug_implementations)]
600594
pub struct af_alg_iv {
601595
pub ivlen: u32,
602596
pub iv: [::c_uchar; 0],
@@ -1032,44 +1026,6 @@ cfg_if! {
10321026
}
10331027
}
10341028

1035-
#[allow(deprecated)]
1036-
impl af_alg_iv {
1037-
fn as_slice(&self) -> &[u8] {
1038-
unsafe {
1039-
::core::slice::from_raw_parts(
1040-
self.iv.as_ptr(),
1041-
self.ivlen as usize
1042-
)
1043-
}
1044-
}
1045-
}
1046-
1047-
#[allow(deprecated)]
1048-
impl PartialEq for af_alg_iv {
1049-
fn eq(&self, other: &af_alg_iv) -> bool {
1050-
*self.as_slice() == *other.as_slice()
1051-
}
1052-
}
1053-
1054-
#[allow(deprecated)]
1055-
impl Eq for af_alg_iv {}
1056-
1057-
#[allow(deprecated)]
1058-
impl ::fmt::Debug for af_alg_iv {
1059-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1060-
f.debug_struct("af_alg_iv")
1061-
.field("ivlen", &self.ivlen)
1062-
.finish()
1063-
}
1064-
}
1065-
1066-
#[allow(deprecated)]
1067-
impl ::hash::Hash for af_alg_iv {
1068-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1069-
self.as_slice().hash(state);
1070-
}
1071-
}
1072-
10731029
impl PartialEq for prop_info {
10741030
fn eq(&self, other: &prop_info) -> bool {
10751031
self.__name == other.__name &&

src/unix/linux_like/linux/mod.rs

+1-45
Original file line numberDiff line numberDiff line change
@@ -1057,13 +1057,7 @@ s_no_extra_traits! {
10571057
pub absflat: [::__s32; ABS_CNT],
10581058
}
10591059

1060-
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
1061-
/// type are unsound and will be removed in the future.
1062-
#[deprecated(
1063-
note = "this struct has unsafe trait implementations that will be \
1064-
removed in the future",
1065-
since = "0.2.80"
1066-
)]
1060+
#[allow(missing_debug_implementations)]
10671061
pub struct af_alg_iv {
10681062
pub ivlen: u32,
10691063
pub iv: [::c_uchar; 0],
@@ -1531,44 +1525,6 @@ cfg_if! {
15311525
}
15321526
}
15331527

1534-
#[allow(deprecated)]
1535-
impl af_alg_iv {
1536-
fn as_slice(&self) -> &[u8] {
1537-
unsafe {
1538-
::core::slice::from_raw_parts(
1539-
self.iv.as_ptr(),
1540-
self.ivlen as usize
1541-
)
1542-
}
1543-
}
1544-
}
1545-
1546-
#[allow(deprecated)]
1547-
impl PartialEq for af_alg_iv {
1548-
fn eq(&self, other: &af_alg_iv) -> bool {
1549-
*self.as_slice() == *other.as_slice()
1550-
}
1551-
}
1552-
1553-
#[allow(deprecated)]
1554-
impl Eq for af_alg_iv {}
1555-
1556-
#[allow(deprecated)]
1557-
impl ::fmt::Debug for af_alg_iv {
1558-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1559-
f.debug_struct("af_alg_iv")
1560-
.field("ivlen", &self.ivlen)
1561-
.finish()
1562-
}
1563-
}
1564-
1565-
#[allow(deprecated)]
1566-
impl ::hash::Hash for af_alg_iv {
1567-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1568-
self.as_slice().hash(state);
1569-
}
1570-
}
1571-
15721528
impl PartialEq for mq_attr {
15731529
fn eq(&self, other: &mq_attr) -> bool {
15741530
self.mq_flags == other.mq_flags &&

0 commit comments

Comments
 (0)