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

Shorten html::render #82088

Merged
merged 5 commits into from
Mar 5, 2021
Merged

Conversation

Nicholas-Baron
Copy link
Contributor

@Nicholas-Baron Nicholas-Baron commented Feb 14, 2021

The mod.rs for librustdoc's html::render was over 3,000 lines. This PR reduces it to around 2,300 by

  1. Moving Context and associated impls to a separate file
  2. Moving the print_item function and its helpers to a separate file
  3. Moving write_shared and write_minify to their own file

Related to issue #60302.
Edit 1: SharedContext and related impls is only 72 lines and so will not be moved.

@rust-highfive
Copy link
Collaborator

r? @ollie27

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 14, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Feb 16, 2021

r? @GuillaumeGomez

@jyn514 jyn514 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 16, 2021
src/librustdoc/html/render/shared_context.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/context.rs Outdated Show resolved Hide resolved
@Nicholas-Baron Nicholas-Baron force-pushed the shorten_html_render branch 2 times, most recently from 989fadb to 5273ca8 Compare February 16, 2021 22:01
@bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Feb 21, 2021

@GuillaumeGomez this bitrots quickly, it would be nice to review it soon if possible.

@rust-log-analyzer

This comment has been minimized.

@Nicholas-Baron
Copy link
Contributor Author

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

The warning is regarding a is_dummy function in src/librustdoc/clean/types.rs. This file is not modified in this PR and I can find no place where it is used in the code touched by this PR and so I will not touch it, in the hope that some other PR fixes the issue.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment has been minimized.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 4, 2021
@bors
Copy link
Contributor

bors commented Mar 4, 2021

☔ The latest upstream changes (presumably #82756) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 4, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 4, 2021

@bors delegate=Nicholas-Baron

This bitrots pretty quickly, so feel free to approve it yourself once you've fixed the conflict. Please use r=GuillaumeGomez and wait until CI passes on the PR first.

@bors
Copy link
Contributor

bors commented Mar 4, 2021

✌️ @Nicholas-Baron can now approve this pull request

@Nicholas-Baron
Copy link
Contributor Author

@bors: r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Mar 4, 2021

📌 Commit afb8220 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 4, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 5, 2021
… r=GuillaumeGomez

Shorten html::render

The `mod.rs` for librustdoc's `html::render` was over 3,000 lines. This PR reduces it to around 2,300 by
1. Moving `Context` and associated `impl`s to a separate file
2. Moving the `print_item` function and its helpers to a separate file
3. Moving `write_shared` and `write_minify` to their own file

Related to issue rust-lang#60302.
Edit 1: `SharedContext` and related `impl`s is only 72 lines and so will not be moved.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Mar 5, 2021
… r=GuillaumeGomez

Shorten html::render

The `mod.rs` for librustdoc's `html::render` was over 3,000 lines. This PR reduces it to around 2,300 by
1. Moving `Context` and associated `impl`s to a separate file
2. Moving the `print_item` function and its helpers to a separate file
3. Moving `write_shared` and `write_minify` to their own file

Related to issue rust-lang#60302.
Edit 1: `SharedContext` and related `impl`s is only 72 lines and so will not be moved.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 5, 2021
…laumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#76716 (Don't warn for `missing_doc_examples` when item is #[doc(hidden)])
 - rust-lang#82088 (Shorten html::render)
 - rust-lang#82690 (Update rustdoc documentation)
 - rust-lang#82752 (Add a regression test for issue-81712)
 - rust-lang#82765 (Fix polymorphization ICE on associated types in trait decls using const generics in bounds)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Mar 5, 2021
… r=GuillaumeGomez

Shorten html::render

The `mod.rs` for librustdoc's `html::render` was over 3,000 lines. This PR reduces it to around 2,300 by
1. Moving `Context` and associated `impl`s to a separate file
2. Moving the `print_item` function and its helpers to a separate file
3. Moving `write_shared` and `write_minify` to their own file

Related to issue rust-lang#60302.
Edit 1: `SharedContext` and related `impl`s is only 72 lines and so will not be moved.
@bors bors merged commit 2f28361 into rust-lang:master Mar 5, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 5, 2021
@Nicholas-Baron Nicholas-Baron deleted the shorten_html_render branch March 5, 2021 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

8 participants