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

Merge "Structs", "Enums", etc. sections into new "Types" section #92660

Closed
wants to merge 5 commits into from

Conversation

camelid
Copy link
Member

@camelid camelid commented Jan 8, 2022

Closes #92656.

r? @GuillaumeGomez
cc @jsha

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 8, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 8, 2022
@camelid
Copy link
Member Author

camelid commented Jan 8, 2022

Does this need a runtime ID redirect as well? The only links that should break are links to the #structs et al. sections.

@camelid
Copy link
Member Author

camelid commented Jan 8, 2022

Before

image

After

image

@camelid
Copy link
Member Author

camelid commented Jan 8, 2022

For some reason, all the links are blue now. I don't see how that could result from my change though, so maybe this regressed on master but isn't on nightly yet? EDIT: Fixed.

@camelid
Copy link
Member Author

camelid commented Jan 8, 2022

Hmm, master hasn't been pushed to since yesterday though...

@rust-log-analyzer

This comment has been minimized.

@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 8, 2022
The new code is much simpler and easier to understand. In fact, the old
code actually had a subtle bug where it excluded a few item types,
including trait aliases, from the sidebar, even though they are rendered
on the page itself! Now, all sections should show up in the sidebar.
@rust-log-analyzer

This comment has been minimized.

@camelid
Copy link
Member Author

camelid commented Jan 8, 2022

Hmm, looks like the types aren't sorted within their section...

ItemType::Function => 10,
ItemType::Typedef => 12,
ItemType::Union => 13,
ItemType::Typedef => 7,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change will impact the search.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used for rendering module pages I'm pretty sure?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, nevermind. I thought it was the mapping for the search index types...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  IMAGE: x86_64-gnu-tools
##[endgroup]
From https://github.com/rust-lang/rust
 * branch              master     -> FETCH_HEAD
Searching for toolstate changes between 488acf86a75c56d30b16822e953c505a9e4901a7 and 740e603e68750065ee4e5fbf4011011c9b1a0f3f
Rustdoc was updated
##[group]Run src/ci/scripts/verify-channel.sh
src/ci/scripts/verify-channel.sh
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
env:
---
.......... (50/56)
......     (56/56)


/checkout/src/test/rustdoc-gui/module-items-font.goml module-items-font... FAILED
[ERROR] (line 24) "#structs + .item-table .item-left a" not found: for command `assert-css: (
    "#structs + .item-table .item-left a",
    {"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},


/checkout/src/test/rustdoc-gui/sidebar.goml sidebar... FAILED
[ERROR] (line 11) Error: Evaluation failed: "Types" !== "Structs": for command `assert-text: (".sidebar-elems .items > ul > li:nth-child(3)", "Structs")`



command did not execute successfully: "/node-v14.4.0-linux-x64/bin/node" "/checkout/src/tools/rustdoc-gui/tester.js" "--jobs" "16" "--doc-folder" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc" "--tests-folder" "/checkout/src/test/rustdoc-gui"


Build completed unsuccessfully in 0:00:15

1 similar comment
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  IMAGE: x86_64-gnu-tools
##[endgroup]
From https://github.com/rust-lang/rust
 * branch              master     -> FETCH_HEAD
Searching for toolstate changes between 488acf86a75c56d30b16822e953c505a9e4901a7 and 740e603e68750065ee4e5fbf4011011c9b1a0f3f
Rustdoc was updated
##[group]Run src/ci/scripts/verify-channel.sh
src/ci/scripts/verify-channel.sh
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
env:
---
.......... (50/56)
......     (56/56)


/checkout/src/test/rustdoc-gui/module-items-font.goml module-items-font... FAILED
[ERROR] (line 24) "#structs + .item-table .item-left a" not found: for command `assert-css: (
    "#structs + .item-table .item-left a",
    {"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},


/checkout/src/test/rustdoc-gui/sidebar.goml sidebar... FAILED
[ERROR] (line 11) Error: Evaluation failed: "Types" !== "Structs": for command `assert-text: (".sidebar-elems .items > ul > li:nth-child(3)", "Structs")`



command did not execute successfully: "/node-v14.4.0-linux-x64/bin/node" "/checkout/src/tools/rustdoc-gui/tester.js" "--jobs" "16" "--doc-folder" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc" "--tests-folder" "/checkout/src/test/rustdoc-gui"


Build completed unsuccessfully in 0:00:15

@jsha
Copy link
Contributor

jsha commented Jan 21, 2022

Looks like GUI tests are failing. I'd love to get this landed. I think it's a very nice simplification. @camelid any chance you'll have time soon to fix the tests?

@camelid
Copy link
Member Author

camelid commented Jan 21, 2022

Yeah, I'm a bit busy this week, but I'm planning to return to this soon.

@aloucks
Copy link
Contributor

aloucks commented Feb 7, 2022

This is a step backwards in usability and discovery. The corresponding issue has more downvotes than upvotes. Please do not merge this.

@camelid camelid deleted the merge-type-sections branch February 9, 2022 19:37
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 10, 2022
…llaumeGomez

Refactor sidebar printing code

This is the refactoring parts of rust-lang#92660, plus the trait aliases capitalization
consistency fix. I think this will be necessary for rust-lang#92658.

r? `@GuillaumeGomez`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc: Merge "Structs", "Enums", "Unions", and "Type Definitions" sections on module pages
7 participants