rustdoc doesn't allow anchors in links to primitive types. For example, given this code:
cargo doc produces this warning:
warning: `str#examples` contains an anchor, but links to builtin types are already anchored
--> src/lib.rs:1:12
|
1 | //! [test](str#examples)
| ^^^^^^^^^^^^ contains invalid anchor
|
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
and the resulting link doesn't point to any part of str's documentation, but is rather treated as a normal URL relative to the current page.
The warning claims that “links to builtin types are already anchored”, but this does not appear to be correct. For example, this code:
produces a link to https://doc.rust-lang.org/nightly/std/primitive.str.html, which does not contain an anchor.
Meta
rustc 1.52.0-nightly (b3e19a221 2021-03-12)
binary: rustc
commit-hash: b3e19a221e63dcffdef87e12eadf1f36a8b90295
commit-date: 2021-03-12
host: powerpc64le-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0
rustdoc doesn't allow anchors in links to primitive types. For example, given this code:
//! [test](str#examples)cargo docproduces this warning:and the resulting link doesn't point to any part of
str's documentation, but is rather treated as a normal URL relative to the current page.The warning claims that “links to builtin types are already anchored”, but this does not appear to be correct. For example, this code:
//! [test](str)produces a link to https://doc.rust-lang.org/nightly/std/primitive.str.html, which does not contain an anchor.
Meta