Skip to content

Commit 4799f8c

Browse files
committed
docs: modernize intra doc links
1 parent 45517a5 commit 4799f8c

File tree

12 files changed

+53
-55
lines changed

12 files changed

+53
-55
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,14 @@ jobs:
188188
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
189189
${{ runner.OS }}-build-
190190
191-
- name: Install stable Rust with target (${{ matrix.target }})
192-
uses: dtolnay/rust-toolchain@stable
191+
- name: Install nightly Rust with target (${{ matrix.target }})
192+
uses: dtolnay/rust-toolchain@nightly
193193
with:
194194
targets: ${{ matrix.target }}
195195

196-
- name: cargo doc
197-
run: cargo doc --target=${{ matrix.target }} --features="ufmt serde defmt-03 mpmc_large portable-atomic-critical-section"
196+
- name: cargo rustdoc
197+
env: {"RUSTDOCFLAGS": "-D warnings --cfg docsrs"}
198+
run: cargo rustdoc --target=${{ matrix.target }} --features="ufmt serde defmt-03 mpmc_large portable-atomic-critical-section"
198199

199200
# Run cpass tests
200201
testcpass:

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,7 @@ defmt = { version = ">=0.2.0,<0.4", optional = true }
5151
ufmt = "0.2"
5252

5353
[package.metadata.docs.rs]
54-
all-features = true
54+
features = ["ufmt", "serde", "defmt-03", "mpmc_large", "portable-atomic-critical-section"]
55+
# for the pool module
56+
targets = ["i686-unknown-linux-gnu"]
57+
rustdoc-args = ["--cfg", "docsrs"]

cfail/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ name = "cfail"
55
publish = false
66
version = "0.1.0"
77

8-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9-
108
[dependencies]
119
heapless = { path = ".." }
1210
trybuild = "1.0.18"

src/binary_heap.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,8 @@ impl<'a, T> Hole<'a, T> {
444444
/// Structure wrapping a mutable reference to the greatest item on a
445445
/// `BinaryHeap`.
446446
///
447-
/// This `struct` is created by the [`peek_mut`] method on [`BinaryHeap`]. See
448-
/// its documentation for more.
449-
///
450-
/// [`peek_mut`]: struct.BinaryHeap.html#method.peek_mut
451-
/// [`BinaryHeap`]: struct.BinaryHeap.html
447+
/// This `struct` is created by [`BinaryHeap::peek_mut`].
448+
/// See its documentation for more.
452449
pub struct PeekMut<'a, T, K, const N: usize>
453450
where
454451
T: Ord,

src/indexmap.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use hash32::{BuildHasherDefault, FnvHasher};
1212

1313
use crate::Vec;
1414

15-
/// A [`heapless::IndexMap`](./struct.IndexMap.html) using the default FNV hasher
15+
/// A [`IndexMap`] using the default FNV hasher
1616
///
1717
/// A list of all Methods and Traits available for `FnvIndexMap` can be found in
18-
/// the [`heapless::IndexMap`](./struct.IndexMap.html) documentation.
18+
/// the [`IndexMap`] documentation.
1919
///
2020
/// # Examples
2121
/// ```
@@ -478,15 +478,16 @@ where
478478
}
479479
}
480480

481-
/// Fixed capacity [`IndexMap`](https://docs.rs/indexmap/1/indexmap/map/struct.IndexMap.html)
481+
/// Fixed capacity [`IndexMap`](https://docs.rs/indexmap/2/indexmap/map/struct.IndexMap.html)
482482
///
483483
/// Note that you cannot use `IndexMap` directly, since it is generic around the hashing algorithm
484-
/// in use. Pick a concrete instantiation like [`FnvIndexMap`](./type.FnvIndexMap.html) instead
484+
/// in use. Pick a concrete instantiation like [`FnvIndexMap`] instead
485485
/// or create your own.
486486
///
487487
/// Note that the capacity of the `IndexMap` must be a power of 2.
488488
///
489489
/// # Examples
490+
///
490491
/// Since `IndexMap` cannot be used directly, we're using its `FnvIndexMap` instantiation
491492
/// for this example.
492493
///
@@ -904,7 +905,7 @@ where
904905
}
905906
}
906907

907-
/// Same as [`swap_remove`](struct.IndexMap.html#method.swap_remove)
908+
/// Same as [`swap_remove`](Self::swap_remove)
908909
///
909910
/// Computes in **O(1)** time (average).
910911
///

src/indexset.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use core::{
77
};
88
use hash32::{BuildHasherDefault, FnvHasher};
99

10-
/// A [`heapless::IndexSet`](./struct.IndexSet.html) using the
10+
/// A [`IndexSet`] using the
1111
/// default FNV hasher.
1212
/// A list of all Methods and Traits available for `FnvIndexSet` can be found in
13-
/// the [`heapless::IndexSet`](./struct.IndexSet.html) documentation.
13+
/// the [`IndexSet`] documentation.
1414
///
1515
/// # Examples
1616
/// ```
@@ -41,10 +41,10 @@ use hash32::{BuildHasherDefault, FnvHasher};
4141
/// ```
4242
pub type FnvIndexSet<T, const N: usize> = IndexSet<T, BuildHasherDefault<FnvHasher>, N>;
4343

44-
/// Fixed capacity [`IndexSet`](https://docs.rs/indexmap/1/indexmap/set/struct.IndexSet.html).
44+
/// Fixed capacity [`IndexSet`](https://docs.rs/indexmap/2/indexmap/set/struct.IndexSet.html).
4545
///
4646
/// Note that you cannot use `IndexSet` directly, since it is generic around the hashing algorithm
47-
/// in use. Pick a concrete instantiation like [`FnvIndexSet`](./type.FnvIndexSet.html) instead
47+
/// in use. Pick a concrete instantiation like [`FnvIndexSet`] instead
4848
/// or create your own.
4949
///
5050
/// Note that the capacity of the `IndexSet` must be a power of 2.

src/lib.rs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,26 @@
4343
//!
4444
//! List of currently implemented data structures:
4545
//!
46-
//! - [`Arc`](pool/arc/index.html) -- like `std::sync::Arc` but backed by a lock-free memory pool
47-
//! rather than `#[global_allocator]`
48-
//! - [`Box`](pool/boxed/index.html) -- like `std::boxed::Box` but backed by a lock-free memory pool
49-
//! rather than `#[global_allocator]`
50-
//! - [`BinaryHeap`](binary_heap/struct.BinaryHeap.html) -- priority queue
51-
//! - [`IndexMap`](struct.IndexMap.html) -- hash table
52-
//! - [`IndexSet`](struct.IndexSet.html) -- hash set
53-
//! - [`LinearMap`](struct.LinearMap.html)
54-
//! - [`Object`](pool/object/index.html) -- objects managed by an object pool
55-
//! - [`String`](struct.String.html)
56-
//! - [`Vec`](struct.Vec.html)
57-
//! - [`mpmc::Q*`](mpmc/index.html) -- multiple producer multiple consumer lock-free queue
58-
//! - [`spsc::Queue`](spsc/struct.Queue.html) -- single producer single consumer lock-free queue
46+
#![cfg_attr(
47+
any(arm_llsc, target_arch = "x86"),
48+
doc = "- [`Arc`](pool::arc::Arc) -- like `std::sync::Arc` but backed by a lock-free memory pool rather than `#[global_allocator]`"
49+
)]
50+
#![cfg_attr(
51+
any(arm_llsc, target_arch = "x86"),
52+
doc = "- [`Box`](pool::boxed::Box) -- like `std::boxed::Box` but backed by a lock-free memory pool rather than `#[global_allocator]`"
53+
)]
54+
//! - [`BinaryHeap`] -- priority queue
55+
//! - [`IndexMap`] -- hash table
56+
//! - [`IndexSet`] -- hash set
57+
//! - [`LinearMap`]
58+
#![cfg_attr(
59+
any(arm_llsc, target_arch = "x86"),
60+
doc = "- [`Object`](pool::object::Object) -- objects managed by an object pool"
61+
)]
62+
//! - [`String`]
63+
//! - [`Vec`]
64+
//! - [`mpmc::Q*`](mpmc) -- multiple producer multiple consumer lock-free queue
65+
//! - [`spsc::Queue`] -- single producer single consumer lock-free queue
5966
//!
6067
//! # Optional Features
6168
//!
@@ -72,7 +79,7 @@
7279
//!
7380
//! In other words, changes in the Rust version requirement of this crate are not considered semver
7481
//! breaking change and may occur in patch version releases.
75-
82+
#![cfg_attr(docsrs, feature(doc_cfg), feature(doc_auto_cfg))]
7683
#![cfg_attr(not(test), no_std)]
7784
#![deny(missing_docs)]
7885
#![deny(warnings)]

src/pool/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ use super::treiber::{NonNullPtr, Stack, UnionNode};
7979

8080
/// Creates a new `ArcPool` singleton with the given `$name` that manages the specified `$data_type`
8181
///
82-
/// For more extensive documentation see the [module level documentation](pool/arc/index.html)
82+
/// For more extensive documentation see the [module level documentation](crate::pool::arc)
8383
#[macro_export]
8484
macro_rules! arc_pool {
8585
($name:ident: $data_type:ty) => {

src/pool/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ use super::treiber::{NonNullPtr, Stack, UnionNode};
9090

9191
/// Creates a new `BoxPool` singleton with the given `$name` that manages the specified `$data_type`
9292
///
93-
/// For more extensive documentation see the [module level documentation](pool/boxed/index.html)
93+
/// For more extensive documentation see the [module level documentation](crate::pool::boxed)
9494
#[macro_export]
9595
macro_rules! box_pool {
9696
($name:ident: $data_type:ty) => {

src/pool/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ use super::treiber::{AtomicPtr, NonNullPtr, Stack, StructNode};
7878
/// Creates a new `ObjectPool` singleton with the given `$name` that manages the specified
7979
/// `$data_type`
8080
///
81-
/// For more extensive documentation see the [module level documentation](pool/object/index.html)
81+
/// For more extensive documentation see the [module level documentation](crate::pool::object)
8282
#[macro_export]
8383
macro_rules! object_pool {
8484
($name:ident: $data_type:ty) => {

0 commit comments

Comments
 (0)