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

Rollup of 4 pull requests #84279

Merged
merged 17 commits into from
Apr 17, 2021
Merged

Rollup of 4 pull requests #84279

merged 17 commits into from
Apr 17, 2021

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jsha and others added 17 commits April 12, 2021 22:52
Export a few variables and functions into the global scope because they
are needed both by main.js and search-index.js.
This allows sharing across main.js and search.js without exporting too
many symbols into the global namespace.
People looking for `INADDR_ANY` don't always find
`Ipv4Addr::UNSPECIFIED`; add some documentation and an alias to help.
Instead of using a depth counter and adding "../" to get to the top,
this commit makes rustdoc actually compare the path of what it's
linking from to the path that it's linking to. This makes the resulting
HTML shorter.

Here's a comparison of one of the largest (non-source) files in the
Rust standard library docs (about 4% improvement before gzipping).

    $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html
    2387389 struct.Wrapping.old.html
    2298538 struct.Wrapping.new.html

Most if it can be efficiently gzipped away.

    $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz
    70679 struct.Wrapping.old.html.gz
    70050 struct.Wrapping.new.html.gz

But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
The function `to_src_with_space` doesn't even accept the cache as a parameter,
so it doesn't matter any more what's in it.
This should help make things consistent.
rustdoc: use more precise relative URLs

This is a fairly large diff, and will probably conflict with rust-lang#82815 since it reduces (but does not eliminate) the use of the old depth variable.

Instead of using a depth counter and adding "../" to get to the top, this commit makes rustdoc actually compare the path of what it's linking from to the path that it's linking to. This makes the resulting HTML shorter.

Here's a comparison of one of the largest (non-source) files in the Rust standard library docs (about 4% improvement before gzipping).

    $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html
    2387389 struct.Wrapping.old.html
    2298538 struct.Wrapping.new.html

Most if it can be efficiently gzipped away.

    $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz
    70679 struct.Wrapping.old.html.gz
    70050 struct.Wrapping.new.html.gz

But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
rustdoc: move some search code into search.js

This reduces main.s from 3094 lines to 1587. Also it saves some bytes
of download in the case where search isn't used.

There were a fair number of variables that needed to be accessible in
both main.js and search.js, but I didn't want to put too many symbols in
the global namespace, so I consolidated much of the search-related
state and functions into a new object `window.searchState`.

Demo at https://hoffman-andrews.com/rust/move-search/std/?search=foo
rustdoc: Give a more accurate span for anchor failures

r? `@euclio`
Add documentation to help people find `Ipv4Addr::UNSPECIFIED`

People looking for `INADDR_ANY` don't always find `Ipv4Addr::UNSPECIFIED`;
add some documentation to help.
@rustbot rustbot added the rollup A PR which is a rollup label Apr 17, 2021
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Apr 17, 2021

📌 Commit a3277e2 has been approved by Dylan-DPC

@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 Apr 17, 2021
@bors
Copy link
Contributor

bors commented Apr 17, 2021

⌛ Testing commit a3277e2 with merge 392ba2b...

@bors
Copy link
Contributor

bors commented Apr 17, 2021

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 392ba2b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 17, 2021
@bors bors merged commit 392ba2b into rust-lang:master Apr 17, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants