Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo doc: Fix warnings: broken_intra_doc_links #10

Open
AndersTrier opened this issue Nov 26, 2023 · 0 comments
Open

cargo doc: Fix warnings: broken_intra_doc_links #10

AndersTrier opened this issue Nov 26, 2023 · 0 comments

Comments

@AndersTrier
Copy link
Owner

AndersTrier commented Nov 26, 2023

$ 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/

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

No branches or pull requests

1 participant