Clean up handling of WrongNamespace
in collect_intra_doc_links
#77150
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-intra-doc-links
Area: Intra-doc links, the ability to link to items in docs by name
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
P-low
Low priority
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Rustdoc looks in different namespaces for diagnostics: https://github.com/rust-lang/rust/blob/66a9cfadf89439ad3ea1b67b996c0a90ca4763bf/src/librustdoc/passes/collect_intra_doc_links.rs#L1569-L1572
So this is handled properly:
However (after #76955),
resolution_failure
only looks at other namespaces if there are multiple path segments. So https://github.com/rust-lang/rust/blob/66a9cfadf89439ad3ea1b67b996c0a90ca4763bf/src/librustdoc/passes/collect_intra_doc_links.rs#L1114 and https://github.com/rust-lang/rust/blob/66a9cfadf89439ad3ea1b67b996c0a90ca4763bf/src/librustdoc/passes/collect_intra_doc_links.rs#L1242-L1244 are still necessary, because they handle cases likevalue@file
andtype@file
.It would be nice to clean this up so that
WrongNamespace
is only handled in one place, inresolution_failure
.Originally posted by @jyn514 in #76955 (comment)
The text was updated successfully, but these errors were encountered: