Skip to content

Commit 0c9b044

Browse files
committed
Remove some unsafe impls
1 parent bea1bcb commit 0c9b044

File tree

2 files changed

+2
-90
lines changed

2 files changed

+2
-90
lines changed

src/unix/linux_like/android/mod.rs

Lines changed: 1 addition & 45 deletions
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

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,7 @@ s_no_extra_traits! {
912912
pub absflat: [::__s32; ABS_CNT],
913913
}
914914

915-
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
916-
/// type are unsound and will be removed in the future.
917-
#[deprecated(
918-
note = "this struct has unsafe trait implementations that will be \
919-
removed in the future",
920-
since = "0.2.80"
921-
)]
915+
#[allow(missing_debug_implementations)]
922916
pub struct af_alg_iv {
923917
pub ivlen: u32,
924918
pub iv: [::c_uchar; 0],
@@ -1347,44 +1341,6 @@ cfg_if! {
13471341
}
13481342
}
13491343

1350-
#[allow(deprecated)]
1351-
impl af_alg_iv {
1352-
fn as_slice(&self) -> &[u8] {
1353-
unsafe {
1354-
::core::slice::from_raw_parts(
1355-
self.iv.as_ptr(),
1356-
self.ivlen as usize
1357-
)
1358-
}
1359-
}
1360-
}
1361-
1362-
#[allow(deprecated)]
1363-
impl PartialEq for af_alg_iv {
1364-
fn eq(&self, other: &af_alg_iv) -> bool {
1365-
*self.as_slice() == *other.as_slice()
1366-
}
1367-
}
1368-
1369-
#[allow(deprecated)]
1370-
impl Eq for af_alg_iv {}
1371-
1372-
#[allow(deprecated)]
1373-
impl ::fmt::Debug for af_alg_iv {
1374-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1375-
f.debug_struct("af_alg_iv")
1376-
.field("ivlen", &self.ivlen)
1377-
.finish()
1378-
}
1379-
}
1380-
1381-
#[allow(deprecated)]
1382-
impl ::hash::Hash for af_alg_iv {
1383-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1384-
self.as_slice().hash(state);
1385-
}
1386-
}
1387-
13881344
impl PartialEq for mq_attr {
13891345
fn eq(&self, other: &mq_attr) -> bool {
13901346
self.mq_flags == other.mq_flags &&

0 commit comments

Comments
 (0)