Skip to content

Commit

Permalink
Migrate to doc_auto_cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Nov 7, 2023
1 parent 8f0dafd commit fb4cdc1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ rustc-dep-of-std = [
test-in-browser = []

[package.metadata.docs.rs]
features = ["std", "custom"]
features = ["std", "custom", "zeroize"]
rustdoc-args = ["--cfg", "docsrs"]

# workaround for https://github.com/cross-rs/cross/issues/1345
Expand Down
1 change: 0 additions & 1 deletion src/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ use core::{mem::MaybeUninit, num::NonZeroU32};
/// [top-level documentation](index.html#custom-implementations) this
/// registration only has an effect on unsupported targets.
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "custom")))]
macro_rules! register_custom_getrandom {
($path:path) => {
// TODO(MSRV 1.37): change to unnamed block
Expand Down
1 change: 0 additions & 1 deletion src/error_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![cfg_attr(docsrs, doc(cfg(feature = "std")))]
extern crate std;

use crate::Error;
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
)]
#![no_std]
#![warn(rust_2018_idioms, unused_lifetimes, missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[macro_use]
extern crate cfg_if;
Expand Down Expand Up @@ -362,7 +362,6 @@ pub fn getrandom_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error
/// # Ok(()) }
/// ```
#[cfg(feature = "zerocopy")]
#[cfg_attr(docsrs, doc(cfg(feature = "zerocopy")))]
#[inline]
pub fn value<T: zerocopy::FromBytes + Sized>() -> Result<T, Error> {
let mut value = MaybeUninit::<T>::uninit();
Expand Down

0 comments on commit fb4cdc1

Please sign in to comment.