AndersTrier/reed-solomon-simd

`cargo doc`: Fix warnings: `broken_intra_doc_links`

Opened this issue · 0 comments

$ cargo doc
 Documenting reed-solomon-simd v2.1.0 (/home/anders/git/reed-solomon-simd)
warning: unresolved link to `crate::engine::Neon`
 --> src/lib.rs:1:1
  |
1 | #![doc = include_str!(concat!(env!("OUT_DIR"), "/README-rustdocified.md"))]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: the link appears in this line:
          
          [`Neon`]: crate::engine::Neon
                    ^^^^^^^^^^^^^^^^^^^
  = note: no item named `Neon` in module `engine`
  = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `Neon`
  --> src/engine.rs:23:9
   |
23 | //! - [`Neon`]
   |         ^^^^ no item named `Neon` in scope
   |
   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `Neon`
  --> src/engine/engine_default.rs:24:14
   |
24 |     /// 1. [`Neon`]
   |              ^^^^ no item named `Neon` in scope
   |
   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: `reed-solomon-simd` (lib doc) generated 3 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
   Generated /home/anders/git/reed-solomon-simd/target/doc/reed_solomon_simd/index.html

The problem is that src/engine/engine_neon.rs is not included when generating the docs on x86, but src/engine/engine_default.rs:24:14 contains a reference to it.

I think the right way to fix this, is to use doc_cfg, but is not yet in stable. docs.rs runs nightly though: https://docs.rs/about/builds

https://stackoverflow.com/questions/61417452/how-to-get-a-feature-requirement-tag-in-the-documentation-generated-by-cargo-do
https://docs.rs/doc-cfg/latest/doc_cfg/