Skip to content

Fix broken intra-doc links in the custom_hash example#125

Open
Edu-Amorim wants to merge 2 commits into
mit-dci:mainfrom
Edu-Amorim:fix-docs
Open

Fix broken intra-doc links in the custom_hash example#125
Edu-Amorim wants to merge 2 commits into
mit-dci:mainfrom
Edu-Amorim:fix-docs

Conversation

@Edu-Amorim

Copy link
Copy Markdown

Description

cargo rbmt docs currently fails locally with the current cargo-rbmt:

error: unresolved link to `crate::accumulator::node_hash::BitcoinNodeHash`
 --> examples/custom_hash.rs:2:23
  |
2 | //! [BitcoinNodeHash](crate::accumulator::node_hash::BitcoinNodeHash), the one used by Bitcoin
  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `accumulator` in module `custom_hash`
  |
  = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

error: unresolved link to `crate::accumulator::node_hash::NodeHash`
 --> examples/custom_hash.rs:4:30
  |
4 | //! implement the [NodeHash](crate::accumulator::node_hash::NodeHash) trait for it, and use it
  |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `accumulator` in module `custom_hash`

error: unresolved link to `crate::accumulator::MemForest::MemForest`
  --> examples/custom_hash.rs:12:56
   |
12 | //! This example shows how to use both the [MemForest](crate::accumulator::MemForest::MemForest) and
   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `accumulator` in module `custom_hash`

error: unresolved link to `crate::accumulator::node_hash::NodeHash`
  --> examples/custom_hash.rs:15:16
   |
15 | //! [NodeHash](crate::accumulator::node_hash::NodeHash) for your hash type.
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `accumulator` in module `custom_hash`

error: could not document `rustreexo`
warning: build failed, waiting for other jobs to finish...
Error building docs: command exited with non-zero code `cargo --locked doc --all-features --no-deps --examples -p path+file:///home/edu/Documents/Apps/Projects/Neha/rustreexo#0.5.0`: 101

The doc links in examples/custom_hash.rs use crate::accumulator::... paths.
crate:: inside an example refers to the example binary, not to rustreexo, and the accumulator module was removed in #98, so the links can't resolve.

Verification

Verified by running cargo rbmt docs

Eduardo Amorim added 2 commits June 6, 2026 17:46
These links were broken in three ways:
- `crate::...` inside an example resolves to the example binary itself, never to `rustreexo`
- the paths still pointed at the `accumulator` module, which was removed when the module structure was flattened
- the docs said to implement the `NodeHash` trait, but the trait is `AccumulatorHash`
    - `NodeHash` is a deprecated alias for the concrete `BitcoinNodeHash` type since v0.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant