Skip to content

Commit e3cdfa1

Browse files
authored
Use doc_auto_cfg (#420)
1 parent 18dfe15 commit e3cdfa1

File tree

8 files changed

+5
-19
lines changed

8 files changed

+5
-19
lines changed

chacha20/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
//! [`chacha20poly1305`]: https://docs.rs/chacha20poly1305
101101
102102
#![no_std]
103-
#![cfg_attr(docsrs, feature(doc_cfg))]
103+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
104104
#![doc(
105105
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
106106
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
@@ -335,15 +335,13 @@ impl<R: Rounds, V: Variant> BlockSizeUser for ChaChaCore<R, V> {
335335
}
336336

337337
#[cfg(feature = "zeroize")]
338-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
339338
impl<R: Rounds, V: Variant> Drop for ChaChaCore<R, V> {
340339
fn drop(&mut self) {
341340
self.state.zeroize();
342341
}
343342
}
344343

345344
#[cfg(feature = "zeroize")]
346-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
347345
impl<R: Rounds, V: Variant> ZeroizeOnDrop for ChaChaCore<R, V> {}
348346

349347
/// The ChaCha20 quarter round function

chacha20/src/rng.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ macro_rules! impl_chacha_rng {
335335
///
336336
/// [^3]: Internet Research Task Force, [*ChaCha20 and Poly1305 for IETF Protocols*](
337337
/// https://www.rfc-editor.org/rfc/rfc8439)
338-
#[cfg_attr(docsrs, doc(cfg(feature = "rng")))]
339338
#[derive(Clone)]
340339
pub struct $ChaChaXRng {
341340
/// The ChaChaCore struct
@@ -375,11 +374,9 @@ macro_rules! impl_chacha_rng {
375374
impl CryptoRng for $ChaChaXRng {}
376375

377376
#[cfg(feature = "zeroize")]
378-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
379377
impl ZeroizeOnDrop for $ChaChaXCore {}
380378

381379
#[cfg(feature = "zeroize")]
382-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
383380
impl ZeroizeOnDrop for $ChaChaXRng {}
384381

385382
// Custom Debug implementation that does not expose the internal state

chacha20/src/xchacha.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ impl<R: Rounds> StreamCipherSeekCore for XChaChaCore<R> {
9595
}
9696

9797
#[cfg(feature = "zeroize")]
98-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
9998
impl<R: Rounds> ZeroizeOnDrop for XChaChaCore<R> {}
10099

101100
/// The HChaCha function: adapts the ChaCha core function in the same

hc-256/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
//! [HC-256]: https://en.wikipedia.org/wiki/HC-256
5050
5151
#![no_std]
52-
#![cfg_attr(docsrs, feature(doc_cfg))]
52+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
5353
#![doc(
5454
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
5555
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
@@ -233,7 +233,6 @@ impl Hc256Core {
233233
}
234234

235235
#[cfg(feature = "zeroize")]
236-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
237236
impl Drop for Hc256Core {
238237
fn drop(&mut self) {
239238
self.ptable.zeroize();
@@ -243,7 +242,6 @@ impl Drop for Hc256Core {
243242
}
244243

245244
#[cfg(feature = "zeroize")]
246-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
247245
impl ZeroizeOnDrop for Hc256Core {}
248246

249247
struct Backend<'a>(&'a mut Hc256Core);

rabbit/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
//! [Rabbit]: https://tools.ietf.org/html/rfc4503#section-2.3
5050
5151
#![no_std]
52-
#![cfg_attr(docsrs, feature(doc_cfg))]
52+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
5353
#![doc(
5454
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
5555
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
@@ -298,7 +298,6 @@ impl StreamCipherCore for RabbitKeyOnlyCore {
298298
}
299299

300300
#[cfg(feature = "zeroize")]
301-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
302301
impl ZeroizeOnDrop for RabbitKeyOnlyCore {}
303302

304303
/// Core state of the Rabbit stream cipher initialized with key and IV.
@@ -359,5 +358,4 @@ impl StreamCipherBackend for Backend<'_> {
359358
}
360359

361360
#[cfg(feature = "zeroize")]
362-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
363361
impl ZeroizeOnDrop for RabbitCore {}

rc4/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![no_std]
2-
#![cfg_attr(docsrs, feature(doc_cfg))]
2+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
33
#![doc = include_str!("../README.md")]
44
#![doc(
55
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
@@ -100,7 +100,6 @@ impl<KeySize> StreamCipherCore for Rc4Core<KeySize> {
100100
}
101101

102102
#[cfg(feature = "zeroize")]
103-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
104103
impl<KeySize> ZeroizeOnDrop for Rc4Core<KeySize> where KeySize: ArraySize {}
105104

106105
struct Backend<'a>(&'a mut Rc4State);

salsa20/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
//! [Salsa]: https://en.wikipedia.org/wiki/Salsa20
6868
6969
#![no_std]
70-
#![cfg_attr(docsrs, feature(doc_cfg))]
70+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
7171
#![doc(
7272
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
7373
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
@@ -246,13 +246,11 @@ impl<R: Unsigned> StreamCipherSeekCore for SalsaCore<R> {
246246
}
247247

248248
#[cfg(feature = "zeroize")]
249-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
250249
impl<R: Unsigned> Drop for SalsaCore<R> {
251250
fn drop(&mut self) {
252251
self.state.zeroize();
253252
}
254253
}
255254

256255
#[cfg(feature = "zeroize")]
257-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
258256
impl<R: Unsigned> ZeroizeOnDrop for SalsaCore<R> {}

salsa20/src/xsalsa.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ impl<R: Unsigned> StreamCipherSeekCore for XSalsaCore<R> {
7676
}
7777

7878
#[cfg(feature = "zeroize")]
79-
#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
8079
impl<R: Unsigned> ZeroizeOnDrop for XSalsaCore<R> {}
8180

8281
/// The HSalsa20 function defined in the paper "Extending the Salsa20 nonce"

0 commit comments

Comments
 (0)