Skip to content

rustdoc::broken_intra_doc_links won't catch obvious invalid links #130126

Open
@SteveLauC

Description

@SteveLauC

I tried this code:

Lint rustdoc::broken_intra_doc_links warns by default, but it cannot catch obvious invalid links in the fanotify module of the Nix crate.

See the section Steps to reproduce for how to reproduce this behavior.

I expected to see this happen: explanation

Invalid links will be caught

Instead, this happened: explanation

They are not caught

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
binary: rustc
commit-hash: 3f5fd8dd41153bc5fdca9427e9e05be2c767ba23
commit-date: 2024-08-06
host: aarch64-apple-darwin
release: 1.80.1
LLVM version: 18.1.7
Backtrace

no backtrace

Context:

Today I found some invalid links in the Nix crate, and fixed them in this PR nix-rust/nix#2493, then I am surprised that they weren't caught by this lint

Steps to reproduce

$ git clone https://github.com/nix-rust/nix.git
$ cd nix
$ git reset --hard 82301035e4af3ca7903ba1abaf1955b2de61c8d5 # This is a commit where the invalid links exist
$ cargo doc --target x86_64-unknown-linux-gnu --all-features

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
   Generated /Users/steve/Documents/workspace/test/target/x86_64-unknown-linux-gnu/doc/nix/index.html
$ echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions