You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bstr has errors building documentation when doing so with --no-default-features.
$ cargo doc --no-default-featureswarning: unresolved link to `ByteVec::unescape_bytes` --> src/ext_slice.rs:2783:40 |2783 | /// The dual of this function is [`ByteVec::unescape_bytes`]. | ^^^^^^^^^^^^^^^^^^^^^^^ no item named `ByteVec` in scope | = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by defaultwarning: unresolved link to `BString` --> src/ext_slice.rs:2786:42 |2786 | /// implementation on [`BStr`] and [`BString`]. The `Debug` implementations | ^^^^^^^ no item named `BString` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`warning: `bstr` (lib doc) generated 2 warnings Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Additionally, the vast majority of intra-doc linking in this crate is hardcoding links to HTML pages that rustdoc generates. Linking in this way prevents rustdoc from properly linting whether the items being referenced exist (which is especially nice in the presence of conditional compilation).
Example links that are broken are this link to BString on the BStr type docs:
I've found adding this env var to CI and building the docs as part of the CI steps that test the feature matrix to be useful in preventing regressions here:
So the direct HTML links were written that way because they were written well before intra doc links... Someone "just" has to go through and fix them.
I'm aware of the first issue, which is that some links are broken when not all features are enabled. I don't know how to fix that. Unless there's some elegant solution, I think we just have to live with the warnings.
for the broken links when not all features are enabled, I've been using a trick with cfg_attr and doc attributes to fill in hardcoded links to docs.rs or the std docs when features are not activated:
It's a neat trick but I don't see myself doing that. Waaaaay too much work and way too messy. I would much rather just have warnings and broken links personally.
bstr
has errors building documentation when doing so with--no-default-features
.Additionally, the vast majority of intra-doc linking in this crate is hardcoding links to HTML pages that rustdoc generates. Linking in this way prevents rustdoc from properly linting whether the items being referenced exist (which is especially nice in the presence of conditional compilation).
bstr/src/lib.rs
Lines 338 to 354 in b3cab19
Example links that are broken are this link to
BString
on theBStr
type docs:I've found adding this env var to CI and building the docs as part of the CI steps that test the feature matrix to be useful in preventing regressions here:
RUSTDOCFLAGS="-D warnings -D rustdoc::broken_intra_doc_links --cfg docsrs"
The text was updated successfully, but these errors were encountered: