Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: Struct variant fields don't have the right path in the search index #16017

Closed
tomjakubowski opened this issue Jul 26, 2014 · 5 comments · Fixed by #68668
Closed

rustdoc: Struct variant fields don't have the right path in the search index #16017

tomjakubowski opened this issue Jul 26, 2014 · 5 comments · Fixed by #68668
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tomjakubowski
Copy link
Contributor

#![crate_type="lib"]
#![feature(struct_variant)]

pub enum Enum {
    Bar { pub name: String }
}

Running rustdoc on this, and then searching for name yields one result, with the incorrect path foo::Enum::Enum::name. Because the path is wrong, the link is also broken.

@tomjakubowski
Copy link
Contributor Author

Vaguely related to #19922

@eddyb eddyb added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Dec 20, 2014
@tomjakubowski
Copy link
Contributor Author

Still broken. Updated code sample:

#![crate_type="lib"]

pub enum Enum {
    Bar { name: String }
}

@steveklabnik
Copy link
Member

Triage: no change.

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 21, 2017
@steveklabnik
Copy link
Member

Triage: no change

@tomjakubowski
Copy link
Contributor Author

tomjakubowski commented Sep 12, 2019

Can still reproduce this bug. I'll have a go at it!

Update 2019-09-22: still working on this, I've found a path to a solution and will submit a PR soon.

tomjakubowski added a commit to tomjakubowski/rust that referenced this issue Sep 23, 2019
TODO: add a test and write up an explanation
TODO: also, don't rename stack to path_stack

closes rust-lang#16017
tomjakubowski added a commit to tomjakubowski/rust that referenced this issue Sep 24, 2019
On the backend, rustdoc now emits `paths` entries to a crate's search
index for struct-like enum variants, and index items of type structfield
which belong to such variants point to their variant parents in the
`paths` table, rather than their enum grandparents.  The path entry for
a variant is the fully qualified module path plus the enum name.

On the frontend, the search code recognizes structfields belonging to
structlike variants in the `paths` table and re-constructs the URL to
the field's anchor on the enum documentation page.

closes rust-lang#16017
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 1, 2020
…-search, r=kinnison

Struct variant field search

Fixes rust-lang#16017.

Reopening of rust-lang#64724.

cc @tomjakubowski
cc @ollie27

r? @kinnison
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 1, 2020
…-search, r=kinnison

Struct variant field search

Fixes rust-lang#16017.

Reopening of rust-lang#64724.

cc @tomjakubowski
cc @ollie27

r? @kinnison
bors added a commit that referenced this issue Feb 15, 2020
…ollie27

Struct variant field search

Fixes #16017.

Reopening of #64724.

cc @tomjakubowski
cc @ollie27

r? @kinnison
@bors bors closed this as completed in 05c6f32 Feb 16, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
4 participants