Skip to content

Commit 1f5267d

Browse files
authored
chore: apply unreachable_pub lint to crates (#734)
1 parent 5be967d commit 1f5267d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+152
-144
lines changed

ascon-hash/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
66
)]
77
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8-
#![warn(missing_docs)]
8+
#![warn(missing_docs, unreachable_pub)]
99

1010
use core::marker::PhantomData;
1111

belt-hash/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
66
)]
77
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8-
#![warn(missing_docs)]
8+
#![warn(missing_docs, unreachable_pub)]
99
#![forbid(unsafe_code)]
1010

1111
pub use digest::{self, Digest};

blake2/src/as_bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use core::mem;
99
use core::slice;
1010

1111
#[allow(clippy::missing_safety_doc)]
12-
pub unsafe trait Safe {}
12+
pub(crate) unsafe trait Safe {}
1313

14-
pub trait AsBytes {
14+
pub(crate) trait AsBytes {
1515
fn as_bytes(&self) -> &[u8];
1616
}
1717

blake2/src/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![allow(clippy::unreadable_literal)]
22

3-
pub static SIGMA: [[usize; 16]; 12] = [
3+
pub(crate) static SIGMA: [[usize; 16]; 12] = [
44
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
55
[14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3],
66
[11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4],
@@ -15,7 +15,7 @@ pub static SIGMA: [[usize; 16]; 12] = [
1515
[14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3],
1616
];
1717

18-
pub static BLAKE2B_IV: [u64; 8] = [
18+
pub(crate) static BLAKE2B_IV: [u64; 8] = [
1919
0x6a09e667f3bcc908,
2020
0xbb67ae8584caa73b,
2121
0x3c6ef372fe94f82b,
@@ -34,7 +34,7 @@ pub const BLAKE2B_SALTBYTES : usize = 16;
3434
pub const BLAKE2B_PERSONALBYTES : usize = 16;
3535
*/
3636

37-
pub static BLAKE2S_IV: [u32; 8] = [
37+
pub(crate) static BLAKE2S_IV: [u32; 8] = [
3838
0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19,
3939
];
4040

blake2/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
)]
77
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
88
#![allow(unexpected_cfgs)] // `simd` feature is broken
9-
#![warn(missing_docs)]
9+
#![warn(missing_docs, unreachable_pub)]
1010
#![cfg_attr(feature = "simd", feature(platform_intrinsics, repr_simd))]
1111
#![cfg_attr(feature = "simd", allow(incomplete_features))]
1212

blake2/src/simd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ mod simdint;
1010
mod simdop;
1111
mod simdty;
1212

13-
pub use self::simdty::{u32x4, u64x4};
13+
pub(crate) use self::simdty::{u32x4, u64x4};
1414

15-
pub trait Vector4<T>: Copy {
15+
pub(crate) trait Vector4<T>: Copy {
1616
fn gather(src: &[T], i0: usize, i1: usize, i2: usize, i3: usize) -> Self;
1717

1818
#[allow(clippy::wrong_self_convention)]

blake2/src/simd/simd_opt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ pub mod u64x4;
3030
#[cfg(not(feature = "simd"))]
3131
macro_rules! simd_opt {
3232
($vec:ident) => {
33-
pub mod $vec {
33+
pub(crate) mod $vec {
3434
use crate::simd::simdty::$vec;
3535

3636
#[inline(always)]
37-
pub fn rotate_right_const(vec: $vec, n: u32) -> $vec {
37+
pub(crate) fn rotate_right_const(vec: $vec, n: u32) -> $vec {
3838
$vec::new(
3939
vec.0.rotate_right(n),
4040
vec.1.rotate_right(n),

blake2/src/simd/simdty.rs

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,24 @@ macro_rules! decl_simd {
3535
}
3636

3737
decl_simd! {
38-
pub struct Simd2<T>(pub T, pub T);
39-
pub struct Simd4<T>(pub T, pub T, pub T, pub T);
40-
pub struct Simd8<T>(pub T, pub T, pub T, pub T,
41-
pub T, pub T, pub T, pub T);
42-
pub struct Simd16<T>(pub T, pub T, pub T, pub T,
43-
pub T, pub T, pub T, pub T,
44-
pub T, pub T, pub T, pub T,
45-
pub T, pub T, pub T, pub T);
46-
pub struct Simd32<T>(pub T, pub T, pub T, pub T,
47-
pub T, pub T, pub T, pub T,
48-
pub T, pub T, pub T, pub T,
49-
pub T, pub T, pub T, pub T,
50-
pub T, pub T, pub T, pub T,
51-
pub T, pub T, pub T, pub T,
52-
pub T, pub T, pub T, pub T,
53-
pub T, pub T, pub T, pub T);
38+
pub(crate) struct Simd2<T>(pub(crate) T, pub(crate) T);
39+
pub(crate) struct Simd4<T>(pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T);
40+
pub(crate) struct Simd8<T>(pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
41+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T);
42+
43+
pub(crate) struct Simd16<T>(pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
44+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
45+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
46+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T);
47+
48+
pub(crate) struct Simd32<T>(pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
49+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
50+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
51+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
52+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
53+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
54+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T,
55+
pub(crate) T, pub(crate) T, pub(crate) T, pub(crate) T);
5456
}
5557

5658
#[cfg(feature = "zeroize")]
@@ -63,22 +65,22 @@ impl<T: Zeroize> Zeroize for Simd4<T> {
6365
}
6466
}
6567

66-
pub type u64x2 = Simd2<u64>;
68+
pub(crate) type u64x2 = Simd2<u64>;
6769

68-
pub type u32x4 = Simd4<u32>;
69-
pub type u64x4 = Simd4<u64>;
70+
pub(crate) type u32x4 = Simd4<u32>;
71+
pub(crate) type u64x4 = Simd4<u64>;
7072

71-
pub type u16x8 = Simd8<u16>;
72-
pub type u32x8 = Simd8<u32>;
73+
pub(crate) type u16x8 = Simd8<u16>;
74+
pub(crate) type u32x8 = Simd8<u32>;
7375

74-
pub type u8x16 = Simd16<u8>;
75-
pub type u16x16 = Simd16<u16>;
76+
pub(crate) type u8x16 = Simd16<u8>;
77+
pub(crate) type u16x16 = Simd16<u16>;
7678

77-
pub type u8x32 = Simd32<u8>;
79+
pub(crate) type u8x32 = Simd32<u8>;
7880

7981
impl<T> Simd4<T> {
8082
#[inline(always)]
81-
pub fn new(e0: T, e1: T, e2: T, e3: T) -> Simd4<T> {
83+
pub(crate) fn new(e0: T, e1: T, e2: T, e3: T) -> Simd4<T> {
8284
Simd4(e0, e1, e2, e3)
8385
}
8486
}

fsb/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
)]
77
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
88
#![forbid(unsafe_code)]
9-
#![warn(missing_docs)]
9+
#![warn(missing_docs, unreachable_pub)]
1010
#![allow(non_snake_case)]
1111

1212
pub use digest::{self, Digest};

gost94/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
66
)]
77
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8-
#![warn(missing_docs)]
8+
#![warn(missing_docs, unreachable_pub)]
99
#![forbid(unsafe_code)]
1010

1111
pub use digest::{self, Digest};

0 commit comments

Comments
 (0)