diff --git a/Cargo.toml b/Cargo.toml index ae26c0e25d..8b783bb2ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,9 @@ include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"] [package.metadata.docs.rs] # To build locally: -# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open +# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --generate-link-to-definition --open all-features = true -rustdoc-args = ["--cfg", "doc_cfg"] +rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"] [package.metadata.playground] features = ["small_rng", "serde1"] diff --git a/rand_chacha/Cargo.toml b/rand_chacha/Cargo.toml index 7584b78826..da22317304 100644 --- a/rand_chacha/Cargo.toml +++ b/rand_chacha/Cargo.toml @@ -15,6 +15,9 @@ categories = ["algorithms", "no-std"] edition = "2021" rust-version = "1.56" +[package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] + [dependencies] rand_core = { path = "../rand_core", version = "0.7.0" } ppv-lite86 = { version = "0.2.14", default-features = false, features = ["simd"] } diff --git a/rand_core/Cargo.toml b/rand_core/Cargo.toml index a3640068e0..7ad22fe7d9 100644 --- a/rand_core/Cargo.toml +++ b/rand_core/Cargo.toml @@ -19,7 +19,7 @@ rust-version = "1.56" # To build locally: # RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open all-features = true -rustdoc-args = ["--cfg", "doc_cfg"] +rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"] [package.metadata.playground] all-features = true diff --git a/rand_distr/Cargo.toml b/rand_distr/Cargo.toml index 49fd2e6f8a..ec4db034a6 100644 --- a/rand_distr/Cargo.toml +++ b/rand_distr/Cargo.toml @@ -16,6 +16,9 @@ edition = "2021" rust-version = "1.56" include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"] +[package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] + [features] default = ["std"] std = ["alloc", "rand/std"] diff --git a/rand_distr/src/geometric.rs b/rand_distr/src/geometric.rs index 3ea8b8f3e1..b8b396dd44 100644 --- a/rand_distr/src/geometric.rs +++ b/rand_distr/src/geometric.rs @@ -143,7 +143,8 @@ impl Distribution for Geometric /// /// See [`Geometric`](crate::Geometric) for the general geometric distribution. /// -/// Implemented via iterated [Rng::gen::().leading_zeros()]. +/// Implemented via iterated +/// [`Rng::gen::().leading_zeros()`](Rng::gen::().leading_zeros()). /// /// # Example /// ``` diff --git a/rand_pcg/Cargo.toml b/rand_pcg/Cargo.toml index 8009976927..c31b461adf 100644 --- a/rand_pcg/Cargo.toml +++ b/rand_pcg/Cargo.toml @@ -15,6 +15,9 @@ categories = ["algorithms", "no-std"] edition = "2021" rust-version = "1.56" +[package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] + [features] serde1 = ["serde"] diff --git a/src/distributions/integer.rs b/src/distributions/integer.rs index 418eea9ff1..3ef746b992 100644 --- a/src/distributions/integer.rs +++ b/src/distributions/integer.rs @@ -18,8 +18,10 @@ use core::arch::x86::{__m128i, __m256i}; use core::arch::x86_64::__m512i; #[cfg(target_arch = "x86_64")] use core::arch::x86_64::{__m128i, __m256i}; -use core::num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, - NonZeroU128}; +use core::num::{ + NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize,NonZeroU128, + NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize,NonZeroI128 +}; #[cfg(feature = "simd_support")] use core::simd::*; use core::mem; @@ -114,6 +116,13 @@ impl_nzint!(NonZeroU64, NonZeroU64::new); impl_nzint!(NonZeroU128, NonZeroU128::new); impl_nzint!(NonZeroUsize, NonZeroUsize::new); +impl_nzint!(NonZeroI8, NonZeroI8::new); +impl_nzint!(NonZeroI16, NonZeroI16::new); +impl_nzint!(NonZeroI32, NonZeroI32::new); +impl_nzint!(NonZeroI64, NonZeroI64::new); +impl_nzint!(NonZeroI128, NonZeroI128::new); +impl_nzint!(NonZeroIsize, NonZeroIsize::new); + macro_rules! x86_intrinsic_impl { ($($intrinsic:ident),+) => {$( /// Available only on x86/64 platforms diff --git a/src/distributions/uniform.rs b/src/distributions/uniform.rs index 713961e8e0..05bb1b6043 100644 --- a/src/distributions/uniform.rs +++ b/src/distributions/uniform.rs @@ -52,7 +52,7 @@ //! `low < high`). The example below merely wraps another back-end. //! //! The `new`, `new_inclusive` and `sample_single` functions use arguments of -//! type SampleBorrow to support passing in values by reference or +//! type `SampleBorrow` to support passing in values by reference or //! by value. In the implementation of these functions, you can choose to //! simply use the reference returned by [`SampleBorrow::borrow`], or you can choose //! to copy or clone the value, whatever is appropriate for your type.