| Age | Commit message (Collapse) | Author | Lines |
|
rustdoc: remove unused HTML class `sidebar-title`
Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no longer styled.
|
|
This allows you to open the help section in a new browser tab, which is a
pretty reasonable thing to want for a documentation page.
|
|
Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no
longer styled.
|
|
|
|
When this was added, the sidebar had a bit more complex style. It can be
removed, now.
|
|
This DOM cleanup changes the color of the triangle, from blue to black, but
since it's still a different color from the link it's next to, it should
still be noticeable.
|
|
Since 50f662e99ec372a3c9558876d4164e8665859217, there is no CSS or JS
targeting this class.
|
|
Since a7c25b29575c17434406b69773f8c2961af343b3 removed `in-band` from code
headers, the only remaining uses of the `in-band` class are:
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/write_shared.rs#L520-L521
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/templates/print_item.html#L2-L3
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/context.rs#L637-L638
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L368-L369
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L401-L402
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/static/js/main.js#L525
Since all of these uses are nested below `h1.fqn`, we can get rid of it,
and the support code that was used for when `in-band` was part of item
rendering.
|
|
Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee,
this time fixing the appearance of methods that have no docblock (we didn't
notice this one because libstd docs *always* have docblocks).
See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html
|
|
rustdoc: add method spacing to trait methods
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait layouts when things are collapsed.
This PR makes two changes to the appearance of trait pages:
* It adds the `method-toggle` class to method toggles on traits, making the DOM more consistent with type pages (which already have this class).
## Before

## After

* It adds a bottom margin to docblocks nested directly in the implementors list, giving it a similar appearance to if it was nested within a toggle.
## Before

## After

|
|
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait
layouts when things are collapsed.
|
|
Instead, it gathers the extra info later, when it's actually requested.
|
|
* Remove the `float: right` fallback from the main header, which hasn't
been needed since IE11 support was dropped.
* Remove `in-band` from low-level headers, which hasn't been needed since
`.rightside` switched to `float: right` in
593d6d1cb15c55c88319470dabb40126c7b7f1e2
* Remove unreachable `.in-band > code, .in-band > .code-header` CSS, since
the `in-band` class was attached to the `code-header` itself, not nested
directly below it.
* Use `rem` instead of `em` for code header margins.
* This results in a slight change in spacing around impls and item-info,
but since it makes it more consistent with the way methods are presented,
it's probably fine.
|
|
rustdoc: clean up CSS/DOM for deprecation warnings
Preview: https://notriddle.com/notriddle-rustdoc-test/stab-p/std/macro.try.html
|
|
|
|
|
|
Unify "all items" page's sidebar with other pages
Currently, the "all types" page's sidebar doesn't list the different categories of type available. This PR fixes it.
Before:

After:

r? `@notriddle`
|
|
|
|
|
|
This class was originally added in 73b97c7e7c9cfac4dfa4804654b1db6ab687b589
to support hiding and showing the item, because `main.js` went through all
`docblock` elements in the DOM and added toggles to them.
https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867
The `item-decl` is no longer auto-hidden since
c96f86de3026f864e78397aff9097e885f2f8fdf removed it.
`item-decl` used to be called `type-decl`: that name was changed in
8b7a2dd4626acf164e1ce8397878b3f5af83d585.
The `docblock` class is no longer used for implementing toggles, since
rustdoc switched to using `<details>` elements.
|
|
This reduces the amount of CSS, and makes these two pages more consistent
(which, necessarily, means changing them a bit).
|
|
As an example, this cuts down
<https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html>
by about 11%.
$ du -h new_mod.rs.html old_mod.rs.html
296K new_mod.rs.html
332K old_mod.rs.html
|
|
Simplify `hir::PathSegment`
r? `@petrochenkov`
|
|
more clippy::perf fixes
|
|
|
|
|
|
|
|
r=notriddle
Remove unneeded where whitespace
It fixes these two bugs:


It's a relic from a very old time (this commit: https://github.com/rust-lang/rust/commit/bfd01b7f40ae2cbfe9acbc1d10e79ffe16870df8).
You can test the result [here](https://rustdoc.crud.net/imperio/remove-unneeded-where-whitespace/lib2/struct.WhereWhitespace.html).
cc `````````@jsha`````````
r? `````````@notriddle`````````
|
|
|
|
rustdoc: Resugar async fn return type in `clean`, not `html`
This way it also happens for json output.
Fixes #101199
r? ``@GuillaumeGomez``
|
|
|
|
|
|
This way it also happens for json output.
Fixes #101199
|
|
Avoid cloning a collection only to iterate over it
`@rustbot` label: +C-cleanup
|
|
rustdoc: remove empty extern_crates and type="text/javascript" on script
Like #101023, this removes an attribute with a default value.
|
|
r=GuillaumeGomez
rustdoc: omit start/end tags for empty item description blocks
Related to #100952
This is definitely not a complete solution, but it does shrink keysyms/index.html on smithay from 620K to 516K.
|
|
Like #101023, this removes an attribute with a default value.
|
|
Fix doc cfg on reexports
Fixes #83428.
The problem was that the newly inlined item cfg propagation was not working since its real parent is different than its current one.
For the implementation, I decided to put it directly into `CfgPropagation` instead of inside `inline.rs` because I thought it would be simpler to maintain and to not forget if new kind of items are added if it's all done in one place.
r? `@notriddle`
|
|
Related to #100952
This is definitely not a complete solution, but it does shrink
keysyms/index.html on smithay from 620K to 516K.
|
|
|
|
|
|
|
|
Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8.
Add a `is_known_utf8` flag to `Wtf8Buf`, which tracks whether the
string is known to contain UTF-8. This is efficiently computed in many
common situations, such as when a `Wtf8Buf` is constructed from a `String`
or `&str`, or with `Wtf8Buf::from_wide` which is already doing UTF-16
decoding and already checking for surrogates.
This makes `OsString::into_string` O(1) rather than O(N) on Windows in
common cases.
And, it eliminates the need to scan through the string for surrogates in
`Args::next` and `Vars::next`, because the strings are already being
translated with `Wtf8Buf::from_wide`.
Many things on Windows construct `OsString`s with `Wtf8Buf::from_wide`,
such as `DirEntry::file_name` and `fs::read_link`, so with this patch,
users of those functions can subsequently call `.into_string()` without
paying for an extra scan through the string for surrogates.
r? `@ghost`
|
|
rustdoc: strategic boxing to reduce the size of ItemKind and Type
The `Type` change redesigns `QPath` to box the entire data structure instead of boxing `self_type` and the `trait_`.
This reduces the size of several `ItemKind` variants, leaving `Impl` as the biggest variant. The `ItemKind` change boxes that variant's payload.
|
|
[rustdoc] Fix item info display
Fixes #100369.
The solution I came up with was simply to wrap the "text part" of the `item-info` into another span so that `flex` wouldn't mess with it.
Live demo is [here](https://rustdoc.crud.net/imperio/fix-item-info/foo/struct.ItemInfo.html).
r? ``@jsha``
|
|
|
|
|
|
This reduces the size of Type.
|
|
|
|
|