Skip to content

1307 broken links in the Rust documentation #14515

Closed
@chris-morgan

Description

@chris-morgan

(Sorry, I couldn’t invent 30 more.)

I have a massive list of bad links from crawling doc.rust-lang.org (1307 of them). Most of them arise from bugs in rustdoc, though a few are bad from other manual causes.

Here are the some patterns that I have identified that cause them and which I have omitted from the data set below:

  • There are 165 links of the form Some(…) are being produced in rustdoc::html::render::item_module, where item.href() (an Option<String>) is being written directly without unwrapping. rustdoc: Create anchor pages for primitive types #14513
  • The implementors/….js pattern accounts for 247 404s, because there is no stub JS file if nothing implements the trait. I am not fond of the technique being used, but given it in its current state, we should produce stub JS files that simply do nothing, to avoid a 404.
  • There are 42 with a ?gotosrc=… in them, omitted as I am informed that it has been fixed, just that the online docs haven’t been updated yet. rustdoc: cross-crate source links are one level lower. #14458

Some other observations:

  • The links in trait implementations appear at a brief look-over to be causing the most problems. Most of the links that I have not categorised probably boil down to just a few bugs in this area; here are two I have identified:
    • Getting the private path (e.g. serialize::serialize::Encodable rather than its canonical public path, serialize::Encodable; I have omitted 771 (!) broken links for serialize::serialize, 8 for std::io::mem::MemWriter, and probably more of the remaining ones are from this same thing); rustdoc: Create anchor pages for primitive types #14513
    • Including private (e.g. HomingIO which is in a private module) and/or #[doc(hidden)] (e.g. RcBoxPtr) traits in the “traits this type implements” section;
  • We used to have enum.Result.html, now all enums are type.Result.html. This has broken manual links both inside the documentation (15, by the looks of it) and outside the documentation, and should be reverted.

Anyway, here’s the list of ones that I haven’t removed for reasons mentioned above:

Target Source
http://doc.rust-lang.org/doc/master/rust.html#logging-system http://doc.rust-lang.org/complement-lang-faq.html
../std/str/enum.MaybeOwned.html http://doc.rust-lang.org/complement-cheatsheet.html
../std/io/buffered/struct.BufferedReader.html http://doc.rust-lang.org/complement-cheatsheet.html
../std/vec/trait.ImmutableVector.html#tymethod.iter http://doc.rust-lang.org/complement-cheatsheet.html
../std/vec/trait.MutableVector.html#tymethod.mut_iter http://doc.rust-lang.org/complement-cheatsheet.html
../std/vec/trait.OwnedVector.html#tymethod.move_iter http://doc.rust-lang.org/complement-cheatsheet.html
../../alloc/rc/trait.RcBoxPtr.html http://doc.rust-lang.org/std/rc/struct.Rc.html
../alloc/arc/struct.ArcInner.html http://doc.rust-lang.org/sync/struct.Arc.html
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/
../../alloc/rc/trait.RcBoxPtr.html http://doc.rust-lang.org/std/rc/struct.Weak.html
../../alloc/rc/trait.RcBoxPtr.html http://doc.rust-lang.org/std/rc/struct.Weak.html
../alloc/arc/struct.ArcInner.html http://doc.rust-lang.org/sync/struct.Weak.html
../regex/re/trait.Replacer.html http://doc.rust-lang.org/regex/struct.NoExpand.html
../regex/re/trait.Replacer.html http://doc.rust-lang.org/regex/trait.Replacer.html
../regex/re/trait.Replacer.html http://doc.rust-lang.org/regex/trait.Replacer.html
../regex/re/trait.Replacer.html http://doc.rust-lang.org/regex/type.Regex.html
../regex/re/trait.Replacer.html http://doc.rust-lang.org/regex/type.Regex.html
../regex/re/trait.Replacer.html http://doc.rust-lang.org/regex/type.Regex.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/file/struct.FileWatcher.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/net/struct.TcpWatcher.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/net/struct.TcpListener.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/net/struct.TcpAcceptor.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/net/struct.UdpWatcher.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/pipe/struct.PipeWatcher.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/pipe/struct.PipeListener.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/pipe/struct.PipeAcceptor.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/process/struct.Process.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/signal/struct.SignalWatcher.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/timer/struct.TimerWatcher.html
../../rustuv/homing/trait.HomingIO.html http://doc.rust-lang.org/rustuv/tty/struct.TtyWatcher.html
../regex/re/type.Regex.html http://doc.rust-lang.org/test/struct.TestOpts.html
../sync/lock/struct.RWLock.html http://doc.rust-lang.org/workcache/struct.Context.html
../sync/lock/struct.RWLock.html http://doc.rust-lang.org/workcache/struct.Context.html
../sync/lock/struct.RWLock.html http://doc.rust-lang.org/workcache/struct.Context.html
../../core/fmt/rt/type.Alignment.html http://doc.rust-lang.org/std/fmt/struct.Formatter.html
../../core/fmt/rt/type.Piece.html http://doc.rust-lang.org/std/fmt/struct.Formatter.html
../../core/fmt/rt/type.Piece.html http://doc.rust-lang.org/std/fmt/struct.Formatter.html
../../core/fmt/rt/type.Alignment.html http://doc.rust-lang.org/std/fmt/struct.Formatter.html
http://doc.rust-lang.org/core/fmt/type.CurrentlyFormatting.html http://doc.rust-lang.org/std/fmt/struct.Formatter.html
../../core/fmt/rt/type.Count.html http://doc.rust-lang.org/std/fmt/struct.Formatter.html
../../core/fmt/rt/type.Method.html http://doc.rust-lang.org/std/fmt/struct.Formatter.html
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/std/result/index.html
../io/trait.Writer.html http://doc.rust-lang.org/core/result/
enum.Result.html#method.ok http://doc.rust-lang.org/core/result/
enum.Result.html#method.ok http://doc.rust-lang.org/core/result/
../../alloc/std/fmt/trait.Show.html http://doc.rust-lang.org/alloc/owned/struct.Box.html
../../alloc/std/fmt/trait.Show.html http://doc.rust-lang.org/alloc/owned/struct.Box.html
../../alloc/std/fmt/trait.Show.html http://doc.rust-lang.org/alloc/owned/struct.Box.html
../../alloc/std/fmt/struct.Formatter.html http://doc.rust-lang.org/alloc/owned/struct.Box.html
../../alloc/std/fmt/type.Result.html http://doc.rust-lang.org/alloc/owned/struct.Box.html
../../alloc/std/fmt/struct.Formatter.html http://doc.rust-lang.org/alloc/owned/struct.Box.html
../../alloc/std/fmt/type.Result.html http://doc.rust-lang.org/alloc/owned/struct.Box.html
../../std/unstable/mutex/struct.NativeMutex.html http://doc.rust-lang.org/green/task/struct.GreenTask.html
../../core/fmt/num/trait.GenericRadix.html http://doc.rust-lang.org/core/fmt/struct.Radix.html
enum.Result.html#method.ok http://doc.rust-lang.org/core/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/core/result/index.html
../io/trait.Writer.html http://doc.rust-lang.org/core/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/core/result/index.html
enum.Result.html#method.ok http://doc.rust-lang.org/core/result/index.html
../io/trait.Writer.html http://doc.rust-lang.org/core/result/index.html
../../collections/hashmap/table/struct.Entries.html http://doc.rust-lang.org/collections/hashmap/type.Entries.html
../../collections/hashmap/table/struct.MutEntries.html http://doc.rust-lang.org/collections/hashmap/type.MutEntries.html
../../alloc/std/option/type.Option.html http://doc.rust-lang.org/alloc/arc/struct.Weak.html
../../alloc/std/option/type.Option.html http://doc.rust-lang.org/alloc/arc/struct.Weak.html
../../alloc/std/option/type.Option.html http://doc.rust-lang.org/alloc/rc/struct.Weak.html
../../alloc/std/option/type.Option.html http://doc.rust-lang.org/alloc/rc/struct.Weak.html
../../../std/unstable/mutex/struct.LockGuard.html http://doc.rust-lang.org/native/io/net/struct.Guard.html
i.e.%20all%20fields%20for%20self%20are%20in%20the%0Afirst%20tuple,%20for%20other1%20are%20in%20the%20second%20tuple,%20etc. http://doc.rust-lang.org/syntax/ext/deriving/generic/type.SubstructureFields.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions