rustdoc: Some items in cache.paths
are non-local
#86798
Labels
A-cross-crate-reexports
Area: Documentation that has been re-exported from a different crate
C-bug
Category: This is a bug.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
I tried this code:
I expected to see this happen: No change in behavior; according to the comment, all items stored in
paths
are local.Instead, this happened: Rustdoc panics on nearly every test case in
src/test/rustdoc
. Here is an example:Why is this bad?
Various parts of rustdoc depend on
paths
being local. For example,rust/src/librustdoc/html/format.rs
Lines 486 to 492 in 56dee7c
external_paths
ifpaths
is None. I don't know if this explictly leads to wrong behavior, but it does mean we can't distiguish between "not in extern_paths because it's local" and "not in extern_paths because of a bug".Here are all the places paths is read (not written):
rust/src/librustdoc/html/render/context.rs
Line 233 in 56dee7c
rust/src/librustdoc/formats/cache.rs
Line 265 in 56dee7c
rust/src/librustdoc/html/render/mod.rs
Line 2120 in 56dee7c
rust/src/librustdoc/html/render/write_shared.rs
Line 491 in 56dee7c
rust/src/librustdoc/html/render/write_shared.rs
Line 531 in 56dee7c
rust/src/librustdoc/html/render/cache.rs
Line 36 in 56dee7c
Meta
HEAD is 0ce2112. I found this while reviewing #86662.
Backtrace
The text was updated successfully, but these errors were encountered: