Stream: rustdoc

Topic: broken intra-doc link issue


view this post on Zulip Eric Huss (Mar 12 2021 at 17:47):

I was wondering if someone could help with a broken intra-doc link issue. It is breaking CI on a few projects (like Cargo), and was introduced in yesterday's nightly.

The issue is that the link to as_mut_ptr in this section is broken. It is a page-relative link to #method.as_mut_ptr.

What is strange is that when the std docs are built via ./x.py test, the link is correct (it is ../../std/primitive.slice.html#method.as_mut_ptr). So the linkchecker on rust's CI is passing. However, the docs as created for distribution are broken.

view this post on Zulip Eric Huss (Mar 12 2021 at 18:18):

It is hard to tell if it is #82641 or #82960. I suspect it is #82641, but it is hard to tell what that PR is doing (there isn't a description, and the link to zulip doesn't really explain anything to me).

view this post on Zulip Eric Huss (Mar 12 2021 at 19:29):

Oh, I think this might be due to #82950, nevermind. The linkcheck scripts use latest master against most recent nightly, and the two are out of sync today. It should resolve tomorrow.

view this post on Zulip Joshua Nelson (Mar 12 2021 at 20:20):

#82641 doesn't have anything to do with the generated /std/ docs, it only affects nightly-rustc.

view this post on Zulip Joshua Nelson (Mar 12 2021 at 20:22):

Eric Huss said:

Oh, I think this might be due to #82950, nevermind. The linkcheck scripts use latest master against most recent nightly, and the two are out of sync today. It should resolve tomorrow.

I'm not sure what you mean by this. https://doc.rust-lang.org/beta/std/io/struct.IoSlice.html#method.as_ptr is also broken, as is stable. Could you post the CI error you're seeing?

view this post on Zulip Joshua Nelson (Mar 12 2021 at 20:32):

but yes, I would expect this to be 82950 if anything

view this post on Zulip Eric Huss (Mar 12 2021 at 20:48):

The error looks like this.

All external books use the linkcheck.sh script to validate links in their own CI in the same way as rust-lang/rust does. One limitation is that it fetches the latest copy of linkchecker/main.rs, but runs against the latest nightly docs. When exceptions are removed from the linkchecker, there's a <24 hour window where CI might fail since the two are slightly out of sync. Once the next nightly is published, everything should be ok.

This is the first time I've seen this in the past couple of years, so I'm not too concerned about it. I was just confused as to what was happening, and had forgotten this possibility.

view this post on Zulip Joshua Nelson (Mar 12 2021 at 20:50):

oh I see, cargo is using the linkcheck binary itself

view this post on Zulip Eric Huss (Mar 12 2021 at 20:50):

Hopefully we get to a point where all exceptions can be removed. :smile:

view this post on Zulip Joshua Nelson (Mar 12 2021 at 20:50):

that would need core/alloc/std to be merged I think

view this post on Zulip Joshua Nelson (Mar 12 2021 at 20:50):

https://github.com/rust-lang/rust/blob/b3e19a221e63dcffdef87e12eadf1f36a8b90295/src/tools/linkchecker/main.rs#L36

view this post on Zulip Eric Huss (Mar 12 2021 at 20:50):

hm, yea, that might take a while :grinning:


Last updated: Oct 11 2021 at 22:34 UTC